1
0

Make proxies work

This commit is contained in:
Johann Bauer
2017-02-25 13:36:24 +01:00
committed by ThomasV
parent d4d93b3928
commit 8e54d5c4d4
4 changed files with 12 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ try:
except Exception as e:
print(e)
print("Error: Could not find icons file.")
print("Please run 'pyrcc4 icons.qrc -o gui/qt/icons_rc.py', and reinstall Electrum")
print("Please run 'pyrcc4 icons.qrc -o gui/qt/icons_rc.py -py3', and reinstall Electrum")
sys.exit(1)
from .util import * # * needed for plugins

View File

@@ -497,12 +497,12 @@ class TorDetector(QThread):
@staticmethod
def is_tor_port(port):
try:
s = socket._socketobject(socket.AF_INET, socket.SOCK_STREAM)
s = (socket._socketobject if hasattr(socket, "_socketobject") else socket.socket)(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(0.1)
s.connect(("127.0.0.1", port))
# Tor responds uniquely to HTTP-like requests
s.send("GET\n")
if "Tor is not an HTTP Proxy" in s.recv(1024):
s.send(b"GET\n")
if b"Tor is not an HTTP Proxy" in s.recv(1024):
return True
except socket.error:
pass