WebRTC (Web Real-Time Communication) is an open-source technology that enables real-time P2P (Peer-to-Peer) communication in browsers and mobile apps without plugins. Google began developing it in 2011, and it is now standardized by the W3C and IETF and supported by all major browsers, including Chrome, Firefox, Safari, and Edge.
WebRTC has three core components. MediaStream captures audio/video streams from the camera and microphone. RTCPeerConnection handles media transmission between peers and is responsible for encryption, codecs, and NAT traversal. RTCDataChannel transmits arbitrary data, such as text and files, bidirectionally.
A signaling process is required to establish a P2P connection. In it, two peers exchange connection information, and WebRTC itself does not define a signaling method. It can be implemented in any way, such as WebSocket, HTTP polling, or Firebase. During signaling, SDP (Session Description Protocol) messages are exchanged to negotiate media information such as codecs, resolution, and ports.
In NAT (Network Address Translation) environments, the ICE (Interactive Connectivity Establishment) framework is used for P2P connections. A STUN (Session Traversal Utilities for NAT) server tells a peer its public IP and port, and when a direct connection is not possible, a TURN (Traversal Using Relays around NAT) server acts as a relay. Typically, 80% of connections are resolved with STUN, and the remaining 20% use TURN.
WebRTC is widely used in video calls, screen sharing, and real-time collaboration tools such as Zoom, Google Meet, Discord, and Facebook Messenger. All media is encrypted with SRTP (Secure Real-time Transport Protocol), which ensures security.