Add a class TorsStreamIsolationCredentialsGenerator that generates unique credentials based on a randomly generated session prefix and an atomic counter. Use this in ConnectThroughProxy
instead of a simple atomic int counter.
This makes sure that different launches of the application won’t share the same credentials, and thus circuits, even in edge cases.
Example with -debug=proxy
:
02025-03-31T16:30:27Z [proxy] SOCKS5 sending proxy authentication 0afb2da441f5c105-0:0afb2da441f5c105-0
12025-03-31T16:30:31Z [proxy] SOCKS5 sending proxy authentication 0afb2da441f5c105-1:0afb2da441f5c105-1
Thanks to hodlinator in #32166 (review) for the idea.