Member-only story
Testing a Socket.IO Service
What is Socket.io and How to Connect and Test With Postman
What is Socket.IO?
Socket.IO is a library that enables low-latency, bidirectional and event-based communication between a client and a server. — https://socket.io/docs/v4/
There are several transports available, including WebSockets and long polling.
If you have ever had the following thoughts, this guide should clear it up.
- I am trying to test this WebSocket, and nothing is working…
- What the hell is this payload with a
42["subscribe", {...}]in it? - Why can’t this library talk to this service, but this other one works?
Long polling has its share of issues; WebSockets can be tricky. It’s gotten a lot easier over the years. When I first worked with Socket.IO, it was not uncommon for a network layer to block a socket, and you would have to default to long polling for those scenarios. It’s the reason I chose Socket.IO, among a few others:
- The ability to handle the various levels of networking support with multiple transports as a fallback
- Handling disconnect/reconnect issues on the client or server








