use Tor to resolve domain names

This commit is contained in:
user234684
2020-11-12 18:55:43 +00:00
committed by GitHub
parent 0589cfb8f7
commit 770b77ea51

View File

@@ -61,7 +61,7 @@ class TorManager:
def __init__(self): def __init__(self):
self.old_tor_connection_pool = None self.old_tor_connection_pool = None
self.tor_connection_pool = urllib3.contrib.socks.SOCKSProxyManager( self.tor_connection_pool = urllib3.contrib.socks.SOCKSProxyManager(
'socks5://127.0.0.1:' + str(settings.tor_port) + '/', 'socks5h://127.0.0.1:' + str(settings.tor_port) + '/',
cert_reqs = 'CERT_REQUIRED') cert_reqs = 'CERT_REQUIRED')
self.tor_pool_refresh_time = time.monotonic() self.tor_pool_refresh_time = time.monotonic()
@@ -76,7 +76,7 @@ class TorManager:
self.old_tor_connection_pool = self.tor_connection_pool self.old_tor_connection_pool = self.tor_connection_pool
self.tor_connection_pool = urllib3.contrib.socks.SOCKSProxyManager( self.tor_connection_pool = urllib3.contrib.socks.SOCKSProxyManager(
'socks5://127.0.0.1:' + str(settings.tor_port) + '/', 'socks5h://127.0.0.1:' + str(settings.tor_port) + '/',
cert_reqs = 'CERT_REQUIRED') cert_reqs = 'CERT_REQUIRED')
self.tor_pool_refresh_time = time.monotonic() self.tor_pool_refresh_time = time.monotonic()