Working with a Multipeer-Ready Signaling Channel
The first thing that’s needed to prepare the way for multipeer calls is a reworked signaling channel. We need one that is capable of coordinating the signals between any set of two peers. The signaling channel we’ve used so far isn’t capable of that, really. But don’t worry: if you examine the server.js file, you’ll see a different namespace—mp_namespace—that is set up for multipeer connections. Let’s look through this code line by line, just like we did in Using a Lightweight Signaling Channel, and use what we learn to improve upon the logic we’ve already written for one-to-one signaling:
| const mp_namespaces = io.of(/^\/[a-z]{4}-[a-z]{4}-[a-z]{4}$/); ... |
Get Programming WebRTC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.