SimpleWebRTC: Under the hood
The original SimpleWebRTC was one of the first Javascript libraries for WebRTC out there; the first public version was released more than five years ago. It offered a simple API that allowed JavaScript developers to prototype stuff quickly without having to understand the intricacies of the WebRTC APIs. “You can build cool stuff with WebRTC in five minutes” was true. Taking it to production at scale remains a bit more difficult.
Under the hood, SimpleWebRTC consisted of a bunch of Javascript modules that let you access the camera, microphone, screen content, a wrapper for the RTCPeerConnection API, and something to keep track of your peers and do all of the signaling. It came with a very simple NodeJS signaling server called signalmaster. Socket.io was used for signaling.
This simplicity came at a cost. SimpleWebRTC was designed for a single use-case: multiparty video chat using direct peer-to-peer connection between the participants. For the more complex problems we had to solve, we needed something better. Which is why we rewrote SimpleWebRTC almost from scratch, taking into account what we had learned in the last five years.