Socket.IO Client

Enter a Socket.IO server URL and press Connect: your browser connects straight to it, emits events with JSON arguments, and logs every event and ack that arrives. This site’s server relays nothing. It is a v4 client, so it cannot connect to a v2 server.

On-deviceNetwork lookupMobile friendly
ConnectionNot connected

This tool is a Socket.IO v4 client (socket.io-client 4.8.4). It cannot connect to a v2 server (the protocol differs). It is for v3 and v4 servers.

http(s):// or ws(s):// with no path (e.g. https://example.com:3000). The namespace and path go in the fields below. The page does not connect when it opens. Only when you press Connect does your browser connect directly to the other side.

Starts with /. The default is / (the main namespace).

The server’s Socket.IO path. The default is /socket.io.

polling is HTTP long requests and is subject to CORS. websocket is not subject to CORS.

E.g. {"token":"…"}. Handed to the server when connecting. Hidden on screen, never saved, never written to the log.

Connection settings (URL etc.) are saved in this browser. The query (after ?), user info and credentials are not saved.

If it does not connect (most common first)

The browser connects straight to the other side. This site’s server does not relay anything.

  1. CORS blocks polling. A Socket.IO server must allow this page’s Origin (https://tools.itlibra.com) in its cors option. With websocket only it is outside CORS, but the server may still check the Origin and refuse. The browser shows the reason only in the developer console, not to the page.
  2. The path or namespace is wrong. The default path is /socket.io. For a namespace that does not exist, the server refuses with “Invalid namespace”.
  3. The Socket.IO versions do not match. This tool is a v4 client and cannot connect to a v2 server.
  4. The server’s authentication (middleware) refused the auth. The message and data of the connection error appear in the log.
  5. This page is https but the address is http:// or ws:// (mixed content). Use https:// or wss://.
  6. A reverse proxy does not pass the Upgrade header, or polling is spread over several servers (sticky sessions are needed).
  7. The server is down, or a firewall closes the port.
Emit an event

An array is sent as several arguments; any other JSON value as one argument. Empty means none. Binary arguments are not supported.

Templates (save what you send and send it again)

Saved only inside this browser (up to 30). Do not put passwords, tokens or other secrets in them.

No saved templates.

Message log

Searches event names, topics and bodies (binary as hex and as text).

0 messages logged (0 shown)

No messages yet. Once connected, what you send and receive is listed here (newest first).

Selected message

Select a message in the list to see its content.

How to use

  1. Enter the server URL (e.g. https://example.com:3000). If needed, choose the namespace, path and transports, and enter auth (JSON).

  2. Press Connect (Ctrl/⌘+Enter also works). Wait until the status says Connected. A connection error shows its message and data in the log.

  3. Enter an event name and arguments (JSON; an array means several arguments) and press Emit. You can also wait for the server’s reply (ack).

  4. Events from the server are listed in the log on the right, all with their event names. Select one to read it as formatted JSON or hex. You can search and save the log.

  5. Save events you send often as templates and send them again.

What it does

Connects straight from your browser

Connecting and messaging happen only between your browser and the other server. This site’s server neither relays nor stores the traffic. Opening the page does not connect; only pressing Connect does.

Namespace, path, auth and transports

Set the namespace and path to connect to, the transports (polling → websocket, websocket only, polling only) and auth (JSON). Auth is hidden on screen and never saved.

Logs every event it receives

Every event from the server is logged with its arguments, whatever its name. When you emit with “wait for an ack”, the server’s reply or the timeout is logged.

Explains connection errors and disconnects

The message of a connection error and the data the server attached are logged. A disconnect is explained using the reasons Socket.IO defines (io server disconnect, ping timeout, transport close and so on).

Search, format and save the log

Up to 2,000 messages and about 50 MB in total are logged. Filter by event name or text, read JSON formatted, and save as JSON Lines or text.

Use cases

  • Check that a Socket.IO server in development answers the events you emit as expected
  • See every event the server pushes, with its name and arguments, in one list
  • Try polling and websocket by changing the transports
  • Check that a connection with auth gets through the server’s middleware
  • Narrow down whether CORS, the namespace or the path stops a connection

Supported formats

Input

Server URL (http, https, ws, wss)Namespace and pathauth and arguments as JSON

Capability matrix

FeatureSupportNotes
Connect as a Socket.IO v4 client (namespace, path, auth, transports)SupportedIt also works with v3 servers
Emit events (JSON arguments) and wait for an ackSupported—
Log every event receivedSupported—
Save events you emit as templates and emit them againSupportedStored only inside this browser
Automatic reconnect after a dropPartialOff by default. When on, it has a limit of 1 to 10 attempts
Connecting to a v2 serverNot supportedA v4 client uses a different protocol from a v2 server and cannot connect
Emitting binary argumentsNot supportedReceived binary arguments are logged by size only
Connecting with headers or a query stringNot supportedBecause of browser limits and because the URL takes no query. Use auth for credentials
Connecting to servers your browser cannot reachNot supportedThis site’s server does not relay

Limits & notes

  • One message is cut at 1 MB (1,048,576 characters of text); anything beyond is not logged. The arguments you send are limited to 1 MB and 20 arguments.
  • The log keeps the newest 2,000 messages and about 50 MB in total, dropping the oldest first. The list shows the newest 300.
  • Sending is limited to 20 per second. The ack wait is 1 to 60 seconds. The answer to the connect is waited for 20 seconds.
  • The URL cannot have a path, query or user name (the namespace and path are separate fields).
  • Only the URL, namespace, path, transports, reconnect settings, event name and templates are saved. Auth is not.
  • While this page is https, an http:// or ws:// address cannot be reached (except in browsers that let localhost through).
  • JSON arguments read large numbers as JavaScript numbers, so integers with many digits may be rounded.

Privacy & safety

The only server contacted is the one at the URL you enter. Traffic goes straight from your browser to it; this site’s server neither relays nor stores it. Auth is not saved and not written to the log. The log disappears when you close the page.

FAQ

Can I connect to a Socket.IO v2 server?
No. This tool is a Socket.IO v4 client (socket.io-client 4.8.4) and its protocol differs from a v2 server’s. It works with v3 and v4 servers.
Why do I get a CORS error with Socket.IO?
polling (HTTP long requests) is subject to CORS, so the server’s cors option must allow this page’s Origin. With websocket only it is outside CORS, but the server may still check the Origin and refuse.
What is the difference between namespace and path?
The path is the URL path that is Socket.IO’s entry point (default /socket.io). A namespace is a logical division inside it (default /). If you join a namespace that does not exist, the server refuses.
What do I put in auth?
A JSON object handed to the server when connecting (e.g. {"token":"…"}). Server middleware reads it and decides whether to allow the connection. This tool hides it on screen and never saves it.
What is an ack?
When you emit an event with a function as the last argument, the server can call that function to reply. That reply is the ack. With “Wait for an ack” on, the tool logs the value that came back in time, or the timeout.
How is this different from the WebSocket and MQTT clients?
Socket.IO is its own protocol on top of WebSocket, adding event names, acks and namespaces. For raw WebSocket use the WebSocket client; for an MQTT broker use the MQTT client.

Last updated: