Tools

WebSocket test

Connect to any WebSocket server from your browser, send messages and read the replies, with the time each one took and every close code explained.

Not connected

Your browser connects straight to the address you enter. Your address and messages are not sent to us or kept.

Using WordPlus Cloud? Test the connection to our servers.

Step by step: WebSocket connection failed: how to test it and what error 1006 means

Reading the results

WebSocket close codes

When a connection ends, the browser gives a close code. These are the ones the standard defines. Codes from 4000 up belong to the server or its library.

CodeWhat it means
1000Normal closure. Either side finished and closed on purpose.
1001Going away. The server is shutting down, or the page was left.
1002Protocol error. One side broke the WebSocket protocol.
1003Unsupported data. One side received a kind of message it does not accept, such as binary where it expects text.
1005No status. The connection closed without giving a code.
1006Abnormal closure. The connection ended with no close message: a refused handshake, a TLS problem, or a network or proxy that dropped it.
1007Invalid data. A text message was not valid UTF-8.
1008Policy violation. The server refused the connection or a message under its rules, often authentication or the origin.
1009Message too big. The other side will not take a message of that size.
1010Missing extension. The client expected an extension the server did not offer.
1011Server error. Something went wrong on the server.
1012Service restart. The server is restarting, so connect again.
1013Try again later. The server cannot take this connection now.
1015TLS failure. The secure connection could not be set up, often because of a certificate.

WordPlus Cloud

Realtime without a server of your own

Your app connects to our realtime servers through our SDKs, with rooms, presence and reconnects, and you run no WebSocket server.

Questions

Frequently asked

How do I test a WebSocket server?

Enter its wss:// address and press Connect. The log shows how long the connection took and each message in both directions, and if it closes, the close code and what it means.

What does close code 1006 mean?

The connection ended with no close message, and browsers give no more detail. The usual reasons are a handshake the server or a proxy refused, a TLS certificate problem, or a network or proxy that drops WebSocket traffic.

Why does my server work locally but fail here?

This page is served over HTTPS, so browsers allow only wss:// here, apart from ws:// to localhost. The server also sees this site as the Origin, so one that allows only its own sites refuses the connection.

Can I send custom headers?

No browser can set headers on a WebSocket. Send a token in the query string, as a subprotocol or in your first message, as every browser client of your server has to.

Do my messages go through WordPlus?

No. Your browser connects straight to the address you entered, and nothing you send or receive reaches us.

Why does the connection drop after about a minute?

Proxies and load balancers often close a connection that has been quiet for a while, commonly after 60 seconds. Send a ping or a small message more often than that.

Do I need to run a WebSocket server of my own?

Not with WordPlus Cloud. Your app connects to our realtime servers through our SDKs, with rooms, presence and reconnects, priced by connections.