Protocols

A Socket.IO client online for events, listeners and acks

Socket.IO is not plain WebSocket: it has its own handshake, namespaces, named events and acknowledgements. The Swastik Codes Socket.IO client speaks that protocol, so you can test a Socket.IO server from the browser without writing a throwaway Node script.

Get started freeSign inOpen the app

Every Socket.IO version you are likely to meet

Pick the client version that matches your server: v2 (Engine.IO 3) or v3/v4 (Engine.IO 4). Choose the transport, WebSocket or HTTP long-polling, and change the handshake path if your server is mounted somewhere other than /socket.io/. Set the namespace (for example /admin) to connect to it directly.

Authentication the way your server reads it

Socket.IO servers usually authenticate in one of three places, and all three are covered:

  • the auth payload sent with the v3/v4 handshake (socket.handshake.auth on the server)
  • headers on the handshake request, such as Authorization
  • query parameters, common in older v2 deployments

The Authorization tab adds the usual helpers, and every field accepts {{variables}} from your environment.

JSON
{ "token": "{{accessToken}}", "room": "support" }

Emit events with arguments and acks

Write an event name and its arguments, either as one JSON array or one argument per row. Arguments can be JSON values or binary data, which is sent as Socket.IO attachments. Tick Ack to wait for the server's acknowledgement callback; the reply appears in the log next to the event that caused it. The ack timeout is configurable, and can be set to wait indefinitely.

A server handler like this one:

JavaScript
io.on("connection", (socket) => {
  socket.on("order:create", (order, ack) => {
    ack({ ok: true, id: crypto.randomUUID() });
  });
});

is tested by emitting order:create with an argument such as {"sku": "A-1"} and ticking Ack. The acknowledgement payload shows up as the reply.

Listen to the events you care about

Add listeners for event names your server emits, such as order:updated or notification. Turn on Show only listened events to hide everything else in a busy namespace. The message log is searchable, can be filtered by sent and received messages, and can be downloaded as JSON.

Settings and reconnection

Handshake timeout, ack timeout, maximum message size, automatic reconnection (attempts and interval) and server certificate verification are all in the Settings tab.

Save sessions with your API

Socket.IO requests live in collections next to HTTP, GraphQL and other protocols. Save common emits for reuse, save a session as an example, and document the events in the request's Docs tab. Connections you open are kept in your history and reopen in the Socket.IO editor.

How it works

  1. Open the app, create a request and change its type to Socket.IO.
  2. Enter the server URL (for example https://realtime.example.com), choose the client version and namespace, and connect.
  3. Emit events, add listeners and watch the log.

Connecting needs a free account: the web app relays the session through the Swastik Codes server, which only connects to public hosts and refuses private and loopback addresses. The desktop app for Windows and Linux connects from your own machine.

Frequently asked questions

Which Socket.IO versions are supported?

Servers running Socket.IO v2 (Engine.IO 3) and v3 or v4 (Engine.IO 4), over WebSocket or HTTP long-polling.

Can I send binary data in an event?

Yes. Binary arguments are sent as Socket.IO attachments, the same way a Node client sends a Buffer.

Why does my connection fail with the plain WebSocket client?

A Socket.IO server expects its own handshake and packet format on top of WebSocket. Use this Socket.IO client instead of the raw WebSocket client.

Can I join a room?

Rooms are a server-side concept in Socket.IO. Emit whatever event your server uses to join a room (for example join with the room name), then listen for the room's events.

Try it on your own API

Swastik Codes runs in the browser and is free to use. Create an account to send requests, sync your workspaces and invite your team.