add a hole punch test server

This commit is contained in:
2026-05-24 17:27:25 -04:00
parent fdef38618b
commit 245ba2980d
2 changed files with 41 additions and 0 deletions

View 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)