Let's say I have a Tor Browser, nodejs and curl all sending requests using Tor's SOCKS5 proxy. Will requests from different clients routed through the same exit node? Or does each client get their own Tor circuit?
1 Answer
If you want to keep steams isolated for each applications, you should connect to Tor's SOCKS proxy using a different username for each application. Otherwise Tor may use the same circuit for streams from different applications. With torsocks you can use the torsocks -i
option to use a SOCKS username/password derived from the current PID and time. You can also isolate streams by setting Tor to use multiple different SOCKS ports, one for each application. You can find the stream isolation code in tor's connection_edge_compatible_with_circuit()
function.
-
So the default behaviour is to use the same circuit? Or is it depending on other factors? May 21, 2020 at 16:30
-
By default it may use the same circuit, but is not guaranteed to (this depends on things like the circuit's exit policy and if the circuit has been marked as 'unusable for new streams' after a period of time). For example loading a webpage typically requires tens or hundreds of HTTP requests, many to different servers/CDNs, so it would be too expensive to use a different circuit for each request.– SteveMay 21, 2020 at 16:44