WebRTC is the protocol powering real-time video and voice in browsers, built on UDP rather than TCP to prioritize low latency over reliability. It bundles seven protocols — SDP, ICE, STUN, TURN, DTLS, SRTP, and RTCP — behind a simple JavaScript API. The core challenge is NAT traversal: connecting two devices that lack public IPs using STUN servers to discover public addresses and TURN servers as fallback relays. Pure peer-to-peer WebRTC scales quadratically and breaks down beyond 3-4 participants; production systems like Discord and Zoom use Selective Forwarding Units (SFUs) that route media packets without decoding them, enabling linear scaling. Production gotchas include TURN server costs (10-15% of connections need relay), building your own signaling server, mobile UDP blocking, cross-browser codec inconsistencies, and recording requiring a separate decoder component.

27m watch time

Sort: