MockFoxAdvertise

WebSocket Tester

Updated Free mock REST & WebSocket APIs

Connect to any WebSocket endpoint, send text or JSON messages and watch every frame in a timestamped log. It's pre-filled with MockFox's free echo server, so you can try it right away.

Not connected
Messages · ↑ 0 sent · ↓ 0 received

Connect, then send a message. The default echo server sends every message straight back.

15 bytes
Saved messages

🔒 The connection goes straight from your browser to the server you enter — MockFox doesn't proxy or record it. Saved messages stay in this browser.

How to test a WebSocket

  1. Enter your server's URL — or keep the echo server — and click Connect.
  2. Type a message or pick a saved one, then press Send (or Ctrl/⌘ + Enter).
  3. Watch sent ↑ and received ↓ messages in the log. Turn on auto-reconnect to test how your server handles dropped connections.
  4. Share a pre-filled tester by adding ?url=, e.g. /websocket-tester?url=wss://example.com/ws.

WebSocket close codes

CodeMeaning
1000Normal closure
1001Going away — server shutting down or page navigating
1006Abnormal — no close frame: network failure, refused handshake or wrong URL
1008Policy violation — often failed authentication
1009Message too big
1011Unexpected server error
1012 / 1013Service restarting / try again later
4000–4999Application-defined codes

Troubleshooting connection failures

  • Mixed content. A page served over https:// can't open an unencrypted ws:// connection to another host. Use wss://.
  • Handshake rejected (1006 straight away). The server answered the upgrade with something other than 101 Switching Protocols — usually a wrong path, missing authentication or an Origin check.
  • No custom headers. The browser WebSocket API can't send an Authorization header. Pass a token in the query string, a subprotocol or a cookie instead.
  • Reverse proxies. nginx needs proxy_http_version 1.1 and must forward the Upgrade and Connection headers.
  • Idle timeouts. Many load balancers drop idle connections after about 60 seconds; send heartbeat messages to keep them open.

Related tools

Frequently asked questions

Does MockFox see my WebSocket traffic?

No. The connection goes straight from your browser to the URL you enter; MockFox doesn't proxy, log or store it. Saved messages are kept only in your browser.

Can I connect to a server on localhost?

Yes. Chrome, Edge and Firefox treat localhost and 127.0.0.1 as secure, so ws://localhost works even from this https page. If your browser blocks it, serve your local server over wss://.

Can I send an Authorization header?

Browsers don't allow custom headers on WebSocket connections. Most servers accept a token as a query parameter (?token=…), a subprotocol or a session cookie instead.

Does it handle binary messages?

Received binary frames are shown with their size and a hex preview of the first 32 bytes. Messages you send are text.

What does the echo server do?

wss://mockfox.dev/api/ws/echo sends every message straight back to you, which makes it handy for checking clients, proxies and firewalls.

Your business here? Sponsor this tool from $16/week. See placements