give tor a bit more time
This commit is contained in:
parent
ebc0f28799
commit
992dc568c2
1 changed files with 2 additions and 1 deletions
|
@ -383,12 +383,13 @@ def can_connect_dns(host="8.8.8.8", port=53):
|
||||||
import state
|
import state
|
||||||
try:
|
try:
|
||||||
sock = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM, 6)
|
sock = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM, 6)
|
||||||
sock.settimeout(1)
|
sock.settimeout(2)
|
||||||
socks_port = state.tor.socks_port if state.tor else 9150
|
socks_port = state.tor.socks_port if state.tor else 9150
|
||||||
sock.set_proxy(socks.SOCKS5, "localhost", socks_port, True)
|
sock.set_proxy(socks.SOCKS5, "localhost", socks_port, True)
|
||||||
sock.connect((host, port))
|
sock.connect((host, port))
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
|
#logger.debug('failed to connect', exc_info=True)
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue