Skip to content

Home

go-turn

STUN and TURN in pure Go, for WebRTC peers that cannot reach each other directly — a symmetric NAT, a full-tunnel VPN, a network that only lets HTTPS out. CGO_ENABLED=0.

One daemon, turnd, serves on one host:

STUNBinding (RFC 8489): a peer learns the address the Internet sees
TURNa relayed UDP address (RFC 8656), reached over UDP, TCP, or TLS on 443 (turns:)
credentialsshort-lived TURN credentials (HMAC, the TURN REST API scheme), minted only after an OpenID Connect login through go-authn
rendezvousa room a host opens and shares as one link; the guest’s answer comes back on its own

It is the relay the go-tex playground uses for live collaboration over go-crdt/collab.

Where to go

You want to…Read
put turnd on a hostDeploying
serve TURN over TLS on 443 beside an HTTPS siteTURN over TLS on 443
prove a deployed relay worksChecking a deployment
call the API from a browser or a Go programThe gRPC API
understand what a room link allowsRooms and admission
know what the relay refuses to doSecurity policy
use the packages directlyPackages

Status

The relay, the credentials, the login and the rendezvous work and are tested. The design is turn#1; what is still open is in the tracker.