Problems with TCP hole punching
问题 I've tried to write a basic TCP hole puncher for a firewall in Python 3 using the principles outlined in this article. I'm having trouble getting anything to connect, though. Here is the code: #!/usr/bin/python3 import sys import socket import _thread as thread def client(): c = socket.socket() c.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) c.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) c.bind((socket.gethostbyname(socket.gethostname()), int(sys.argv[3]))) while(c.connect_ex