diff --git a/socks.py b/socks.py index 83b1435..bce0c4f 100644 --- a/socks.py +++ b/socks.py @@ -343,7 +343,7 @@ def bind(self, *pos, **kw): # some relays drop packets if a port of zero is specified. # Avoid specifying host address in case of NAT though. _, port = self.getsockname() - dst = ("0", port) + dst = ("0.0.0.0", port) self._proxyconn = _orig_socket() proxy = self._proxy_addr() @@ -818,7 +818,7 @@ def connect(self, dest_pair, catch_errors=None): # Protocol error while negotiating with proxy self.close() raise - + @set_self_blocking def connect_ex(self, dest_pair): """ https://docs.python.org/3/library/socket.html#socket.socket.connect_ex @@ -828,7 +828,7 @@ def connect_ex(self, dest_pair): self.connect(dest_pair, catch_errors=True) return 0 except OSError as e: - # If the error is numeric (socket errors are numeric), then return number as + # If the error is numeric (socket errors are numeric), then return number as # connect_ex expects. Otherwise raise the error again (socket timeout for example) if e.errno: return e.errno