Modify WebSocket Client Events with Mock Service Worker

Share this video with your friends

Social Share Links

Send Tweet

Listening to the outgoing WebSocket client events is nice, but how about we modify them?

Let's parse the incoming MessageEvent data using JSON.parse, modify it, and provide its stringified version to the chat.broadcast() call to broadcast a different data.

Resources