One can get a list of circuits available for the tor client to use via the ControlPort. Here is the link to a python script someone wrote to get the list of circuits enter link description here
Is it possible to query for the circuit currently being used from the list of circuits, before it expires and chooses another one? Tor client will use the same circuit for a max of 10 minutes by default, so long as the circuit is stable. The python script from the link gives you all the circuits available, I just to get the circuit being used at the moment instead. Thank you!

1 Answer 1


Tor clients keep a pool of circuits and may use several circuits simultaneously for streams depending on factors such as exit policies, stream isolation, etc. So there is generally not a single "in-use" circuit. And it's not quite true that a circuit is used for only a max of 10 minutes. Generally a circuit is marked as "dirty" (unusable for new streams) 10 minutes after a stream is first attached, but existing streams will continue to use the existing circuit indefinitely.

If you want to know which circuits are currently in use for streams, you may want to get all circuits and filter them down by checking their status, purpose, build flags, and timestamp. You can find circuit properties here. For example you probably want to look at only GENERAL circuits that don't have the IS_INTERNAL flag.

  • Thanks Steve for the clarification. This is what I wanted to understand more. Dec 14, 2020 at 21:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .