Skip to content

Instantly share code, notes, and snippets.

View JohnCMcDonough's full-sized avatar

John McDonough JohnCMcDonough

View GitHub Profile
// udprelay.go
// A small UDP relay/proxy that lets LAN clients discover & talk to a server
// reachable only via a routed overlay (e.g., Tailscale 100.x). It listens on
// specified UDP ports on 0.0.0.0, accepts packets from a LAN CIDR, forwards
// them to a fixed upstream server address, and relays replies back to the
// original client. Works for broadcast discovery (27016) and follow-up traffic
// (e.g., 8766, 9700).
//
// go run udprelay.go -lan-cidr 10.0.0.0/24 -server 100.74.146.12 -ports 27016,8766,9700
//