diff --git a/lib/interface.py b/lib/interface.py index 81f9f2d52..d9d0bdac3 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -72,6 +72,7 @@ class TcpInterface(threading.Thread): # parse server self.server = server self.host, self.port, self.protocol = self.server.split(':') + self.host = str(self.host) self.port = int(self.port) self.use_ssl = (self.protocol == 's') diff --git a/lib/network.py b/lib/network.py index b03c734c9..4cf75c01c 100644 --- a/lib/network.py +++ b/lib/network.py @@ -301,12 +301,11 @@ class Network(util.DaemonThread): def set_proxy(self, proxy): self.proxy = proxy if proxy: - self.print_error("setting proxy", proxy) proxy_mode = proxy_modes.index(proxy["mode"]) + 1 socks.setdefaultproxy(proxy_mode, proxy["host"], int(proxy["port"])) socket.socket = socks.socksocket # prevent dns leaks, see http://stackoverflow.com/questions/13184205/dns-over-proxy - socket.getaddrinfo = lambda *args: [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (str(args[0]), args[1]))] + socket.getaddrinfo = lambda *args: [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))] else: socket.socket = socket._socketobject socket.getaddrinfo = socket._socket.getaddrinfo