This sample demonstrates how to use WebSockets to create a signaling server for WebRTC calling. The signaling server is based on the WebSocket chat sample, but adds support for opening a video call to another user by clicking on their name in the user list sidebar.
See the article Signaling and video calling on MDN for detailed information on how this code works. "# web-rtc"