Reach cameras and doorbells behind residential NAT, every time. UDP, TCP, TLS-443 fallbacks. 1 TB free, 5 TB for $9/month.
The camera sits behind the user's home router. The viewer's phone is on a mobile carrier behind carrier-grade NAT. Two NATs, no public address on either side. STUN fails. The user gets a spinner. Without a TURN relay, your "view live feed" button is broken for a substantial fraction of users — particularly those on mobile or in apartments using shared CGNAT.
This is the textbook case for TURN. Both peers list a TURN server in their iceServers, ICE picks the relayed candidate, and the stream connects.
cfg := webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{URLs: []string{"stun:stun.expressturn.com:3478"}},
{
URLs: []string{
"turn:relay1.expressturn.com:3478?transport=udp",
"turn:relay1.expressturn.com:3478?transport=tcp",
"turns:relay1.expressturn.com:443?transport=tcp",
},
Username: "YOUR_EXPRESSTURN_USERNAME",
Credential: "YOUR_EXPRESSTURN_PASSWORD",
},
},
}
peerConnection, _ := webrtc.NewPeerConnection(cfg)
And remember — only viewing sessions that need TURN consume relay bandwidth. Direct-connect viewers don't.
Why does an IP camera or smart doorbell need TURN?
Both camera and viewer are typically behind NATs. STUN often fails between two NATs. TURN relays the feed regardless of network topology.
Can the camera firmware do TURN directly?
Yes. libwebrtc, GStreamer with webrtcbin, Pion, and most embedded-Linux WebRTC stacks accept standard ICE server configuration.
How much TURN bandwidth does a 1080p camera stream use?
~900 MB per relayed viewer-hour at 2 Mbps. Cameras only relay during active viewing.
Is the video encrypted in transit through TURN?
Yes. DTLS-SRTP end-to-end. The relay never sees plaintext.
Make every camera reachable from every phone.
Sign Up — Free 1 TB/monthRelated: VoIP / SIP · Pion recipe