add a hole punch test server
This commit is contained in:
16
extras/hole-punch-test-server.py
Normal file
16
extras/hole-punch-test-server.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import socket
|
||||
|
||||
SERVER_PORT = 41234
|
||||
SERVER_SEND_PORT = 41235
|
||||
|
||||
sock_recv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sock_recv.bind(("0.0.0.0", SERVER_PORT))
|
||||
sock_send = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sock_send.bind(("0.0.0.0", SERVER_SEND_PORT))
|
||||
|
||||
print("Running...")
|
||||
|
||||
while True:
|
||||
data, addr = sock_recv.recvfrom(1024)
|
||||
print(f"Recieved test from addr {addr}")
|
||||
sock_send.sendto(data, addr)
|
||||
Reference in New Issue
Block a user