udp ipv6
This commit is contained in:
parent
07dc98f60d
commit
4b52f83376
1 changed files with 7 additions and 1 deletions
|
@ -352,8 +352,14 @@ class TCPRelayHandler(object):
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
def _create_remote_socket(self, ip, port):
|
def _create_remote_socket(self, ip, port):
|
||||||
|
addrs = None
|
||||||
if self._remote_udp:
|
if self._remote_udp:
|
||||||
addrs = socket.getaddrinfo(ip, port, 0, socket.SOCK_DGRAM, socket.SOL_UDP)
|
try:
|
||||||
|
addrs = socket.getaddrinfo("::", 0, 0, socket.SOCK_DGRAM, socket.SOL_UDP)
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
if addrs is None:
|
||||||
|
addrs = socket.getaddrinfo("0.0.0.0", 0, 0, socket.SOCK_DGRAM, socket.SOL_UDP)
|
||||||
else:
|
else:
|
||||||
addrs = socket.getaddrinfo(ip, port, 0, socket.SOCK_STREAM, socket.SOL_TCP)
|
addrs = socket.getaddrinfo(ip, port, 0, socket.SOCK_STREAM, socket.SOL_TCP)
|
||||||
if len(addrs) == 0:
|
if len(addrs) == 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue