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.
Connect, then send a message. The default echo server sends every message straight back.
🔒 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
- Enter your server's URL — or keep the echo server — and click Connect.
- Type a message or pick a saved one, then press Send (or Ctrl/⌘ + Enter).
- Watch sent ↑ and received ↓ messages in the log. Turn on auto-reconnect to test how your server handles dropped connections.
- Share a pre-filled tester by adding
?url=, e.g./websocket-tester?url=wss://example.com/ws.
WebSocket close codes
| Code | Meaning |
|---|---|
| 1000 | Normal closure |
| 1001 | Going away — server shutting down or page navigating |
| 1006 | Abnormal — no close frame: network failure, refused handshake or wrong URL |
| 1008 | Policy violation — often failed authentication |
| 1009 | Message too big |
| 1011 | Unexpected server error |
| 1012 / 1013 | Service restarting / try again later |
| 4000–4999 | Application-defined codes |
Troubleshooting connection failures
- Mixed content. A page served over https:// can't open an unencrypted
ws://connection to another host. Usewss://. - 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
Authorizationheader. Pass a token in the query string, a subprotocol or a cookie instead. - Reverse proxies. nginx needs
proxy_http_version 1.1and must forward theUpgradeandConnectionheaders. - 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