From 721a602dd9d2fcfe87799d4f07146455f704b4a9 Mon Sep 17 00:00:00 2001 From: Username Date: Thu, 8 Jan 2026 09:05:03 +0100 Subject: [PATCH] misc: simplify tor proxy URL to avoid circuit exhaustion --- misc.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/misc.py b/misc.py index 0dc4519..6d31222 100644 --- a/misc.py +++ b/misc.py @@ -187,12 +187,9 @@ def categorize_error(exc): def tor_proxy_url(torhost): - """Generate Tor SOCKS5 proxy URL with random credentials for circuit isolation. + """Generate Tor SOCKS5 proxy URL. - Tor treats different username:password as separate streams, using different - circuits. This ensures each connection gets a fresh circuit. + Uses no auth to allow Tor to reuse circuits naturally, avoiding + circuit exhaustion from IsolateSOCKSAuth behavior. """ - chars = string.ascii_lowercase + string.digits - user = ''.join(random.choice(chars) for _ in range(8)) - passwd = ''.join(random.choice(chars) for _ in range(8)) - return 'socks5://%s:%s@%s' % (user, passwd, torhost) + return 'socks5://%s' % torhost