Course lesson

Establish Actual WebSocket Server Connection with MSW

Let's add some realism to our mocks. We can get the server object from the connection listener arguments and establish a connection to the actual WebSocket server by calling server.connect(). Once we do that, our event handler becomes a proxy sitting...

Duration
1 min
Access
Included
Transcript
Needs source

Let's add some realism to our mocks. We can get the server object from the connection listener arguments and establish a connection to the actual WebSocket server by calling server.connect(). Once we do that, our event handler becomes a proxy sitting in-between our client and the actual server.

Resources