WebSocket Tester
Connect to a WebSocket server from your browser, send text, JSON or binary messages and watch every frame in a live log with timestamps and sizes. Auto-reconnect and a repeating message keep long-running tests going.
How to use the WebSocket Tester
- Enter the server URL, for example wss://echo.websocket.org, and optionally a subprotocol.
- Click Connect. The status turns green when the connection is open, and the server's first messages appear in the log.
- Type a message and click Send (or press Ctrl+Enter). Choose Text, JSON or Binary (hex) as the format.
- Watch the log: sent messages are marked with an up arrow, received ones with a down arrow, and connection events in gray. Filter or export it at any time.
- Turn on Auto-reconnect to reconnect automatically when the server closes the connection, and Repeat to send a message on a timer.
WebSocket close codes
When a connection ends, the log shows the close code sent by the server (or set by the browser). The most common ones, from RFC 6455 and the IANA registry:
| Code | Name | What it usually means |
|---|---|---|
| 1000 | Normal Closure | Either side closed the connection on purpose. |
| 1001 | Going Away | The server is shutting down or restarting, or the browser tab was closed. |
| 1002 | Protocol Error | A frame broke the WebSocket protocol. |
| 1003 | Unsupported Data | The server cannot accept this kind of message, for example binary when it expects text. |
| 1005 | No Status Received | The close frame had no code. Set by the browser, never sent on the wire. |
| 1006 | Abnormal Closure | The connection dropped or never opened: wrong URL, refused connection, TLS or proxy problem. Set by the browser. |
| 1007 | Invalid Payload | A text message was not valid UTF-8 or the data did not match what the server expects. |
| 1008 | Policy Violation | The server refused the message or client, often an authentication or origin check. |
| 1009 | Message Too Big | The message is larger than the server allows. |
| 1011 | Internal Error | The server hit an unexpected error. |
| 1012 / 1013 | Service Restart / Try Again Later | Temporary: reconnect after a short wait (auto-reconnect does this for you). |
| 4000–4999 | Application codes | Defined by the app or library you are talking to; check its documentation. |
Debugging a WebSocket connection
- Test against an echo server first. If wss://echo.websocket.org works but your server does not, the problem is on the server side or in the URL.
- Check the path and port. Many servers listen on a specific path such as
/wsor/socket; the root path often returns an error. - Origin checks. Servers may reject handshakes from unknown origins with HTTP 403, which the browser reports as close code 1006.
- Authentication. Browsers cannot add custom headers to the handshake, so pass a token in the query string, a cookie or the first message.
- Keep-alive. Proxies and load balancers often close idle connections after 30 to 120 seconds. Use Repeat message to send a small ping and keep the connection open.
Frequently asked questions
What is a WebSocket?
A WebSocket is a long-lived, two-way connection between a browser and a server, opened with an HTTP Upgrade request and defined in RFC 6455. Unlike regular HTTP requests, both sides can send messages at any time, which makes WebSockets ideal for chat, live dashboards, games and notifications.
What is the difference between ws:// and wss://?
wss:// is WebSocket over TLS, the encrypted equivalent of https://. ws:// is unencrypted. Pages served over HTTPS, like this one, can only open wss:// connections, except to localhost which browsers usually allow for development.
Why does the connection fail with code 1006?
1006 means the connection closed abnormally without a close frame, and browsers do not reveal the reason. Common causes are a wrong URL or port, the server rejecting the Origin header, an invalid TLS certificate, a proxy or firewall blocking WebSockets, or the server being down.
Can I set custom headers such as Authorization?
No. The browser WebSocket API does not allow custom headers. Servers usually accept a token in the URL query string (for example ?token=...), in a cookie, or in the first message after connecting. The subprotocol field is sometimes used for this too.
Does this tool support Socket.IO or STOMP?
It speaks raw WebSocket frames. Socket.IO and STOMP add their own message format on top, so you can talk to them by sending correctly formatted messages yourself, but this tool does not implement those protocols automatically.
Is my traffic sent through FreeToolCabin?
No. Your browser connects directly to the WebSocket server you enter. Messages and logs stay in this tab; only the URL and recent messages are remembered in your browser's local storage for convenience.