You Had Me at WebRTC
The future is distributed. Instead of relying on a server to communicate information between users, they should be able to directly send information to each other. WebRTC enables them to do so.
WebRTC is a Web API to allow real-time browser-to-browser communications, reducing the centrality of servers in multi-user applications such as video conferencing or online chat rooms. It’s a great tool that works in harmony with the existing MediaRecorder API, allowing users to send video and audio from their device’s built-in camera and microphone.
However, network complexities such as firewalls, Network Address Translators (NATs), and various network idiosyncrasies often hinder direct browser-to-browser communication. In order to allow users to talk to each other, they’ll need some help bridging the connection across the interwebs.
This is where ICE comes in. ICE, or Interactive Connectivity Establishment, is a framework for finding methods for two browsers to connect to each other. There are different ways of doing this, the most prominent being STUN and TURN, but generally, each method minimizes the need for the main application server in facilitating inter-client communication.
As effective as ICE is in enabling serverless peer communications, clients initially need some middleman to send network configuration information between them, a process known as signaling. WebRTC doesn’t define a clear method for signaling to increase compatibility with different technologies and applications. This means signaling can be done through a variety of ways, usually a server maintaining bi-directional communications with clients (think WebSockets) but can also be done through other protocols like SIP or even through a lovingly hand-written note delivered by carrier pigeon. However way this initial exchange of information is accomplished, clients can begin to send information among themselves!
The ability for users to directly communicate with peers. It’s been the foundation of many amazing applications such as peer-to-peer data transfer, online video hangouts, and multiplayer games. WebRTC doesn’t just connect users to an application but to a community.