Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions socks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down