Lesson

Broadcast a Mocked Message to All WebSocket Clients

Broadcast data to multiple WebSocket clients using Mock Service Worker.

Access
Included
Transcript
Needs source

Letting you know about the WebSocket connections isn't the only thing a WebSocket link can do. In fact, it also gives you a broadcast() method to send a message to all the connected clients. Let's use that to broadcast a chat message in our app across multiple open browser tabs.

Resources