[BangPypers] UDP Hole Punching using python
kunal.t2 at gmail.com
Fri Feb 25 16:12:31 CET 2011
Hi all, i am working on UDP hole punching to allow communication between two
behind their respective NATs (Home Router).
I have been able to achieve the same using netcat and hping3 , as described
1. Register a SYN flag with the receiving router using hping.(punch a hole
in the NAT)
2. start listening for udp packets at the receiving computer.
3. send a udp packet from the sender to the receiver.
Now i try to do the same thing using python and sockets,
step 1: holepunch , send UDP packet from receiver to sender
from socket import *
s = socket(AF_INET,SOCK_DGRAM)
host = "<receiver ip>"
port = <receiver port>
s.sendto("Message",("<sender ip>",<sender port>))
here i get the following error
*error: [Errno 22] Invalid argument*
i dunno how to resolve this issue.
Also can someone plese help me out with the holepunching. Am i doing
something wrong ?
Dept of Computer Sc. & Engineering.
More information about the BangPypers