Skip to content

Instantly share code, notes, and snippets.

View wesl-ee's full-sized avatar

wesl-ee wesl-ee

View GitHub Profile
[
{
"name": "Levana Dragonfire",
"logo": "https://levana.finance/images/logo.svg",
"links": [
{
"name": "Testnet",
"chain_id": "dragonfire-1",
"url": "https://explorer.juno-dragonfire.levana.wesl.ee"
},
@wesl-ee
wesl-ee / udp-nat-traversal.go
Last active April 15, 2022 15:20
UDP firewall holepunching / NAT traversal demo in Go
/* UDP firewall holepunching / NAT traversal demo in Go
*
* Very simple, send a UDP packet out to a server and await a response. Should
* work even if you are behind a NAT as many home routers will open a firewall
* "hole" for egress datagrams; this way we can connect directly to a server
* without port-forwarding (we cannot do this over TCP, a connection-oriented
* protocol).
*
* Usage (server): go build && ./udp-nat-traversal
* Usage (client): go build && ./udp-nat-traversal 127.0.0.1