Gopunch
gopunch
is a go implementation of a peer-to-peer chat service built using UDP hole punching. This is a toy implementation that I put together to learn how hole punching works. Use at your own risk!
Usage
First, start a punchserver
on some machine with a public IP that has UDP port 1338 open:
$ ./punchserver
Next, connect to the punchserver using your clients. Use the -serverAddr
flag to connect to your server's public ip. Use the -token
flag to identify which two clients the server should connect.
Run the following on both clients. If it worked, you should be able to chat with the other side!
$ ./punchclient -serverAddr
:1338 -token
Sending STUN request to
:1338
Connected to host at
:
hi armaan hi peyton NAT is dead; there are no gods