Skip to content

pawalt/gopunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 <server_ip>:1338 -token <shared_token>
Sending STUN request to <server_ip>:1338
Connected to host at <other_client_ip>:<client_src_port>
hi armaan
hi peyton
NAT is dead; there are no gods

About

UDP hole punching chat server in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages