sondahub / WebSocket test server
WebSocket test server
A free public wss:// echo, and live JSON streams from seven mock APIs that push events on their own — the two things a WebSocket client needs to be tried against. No key, any origin.
Two kinds of socket
- Echo
- wss://api.sondahub.com/v1/utils/ws
- Live JSON
- wss://api.sondahub.com/v1/{api}/ws?topics=a,b
The echo sends back every frame — for testing that a client connects, frames text and binary right, and survives a close. The live streams push a mock API's own activity as JSON, about once a second: orders shipping, devices reporting, FX rates ticking, flights boarding.
From a browser console
const ws = new WebSocket('wss://api.sondahub.com/v1/fleet/ws?topics=telemetry')
ws.onmessage = (e) => console.log(JSON.parse(e.data))
ws.onopen = () => ws.send(JSON.stringify({ type: 'ping' }))
From a terminal, any WebSocket CLI works the same way — npx wscat -c wss://api.sondahub.com/v1/utils/ws, or websocat wss://api.sondahub.com/v1/utils/ws.
What the live streams say
| Direction | Message | Meaning |
|---|---|---|
| server | {"type":"hello", "topics", "subscribed", "tick_ms"} | First message: what this stream offers. |
| server | {"type":"event", "topic", "api", "ts", "data"} | Something happened in the world. |
| you | {"type":"subscribe", "topics":[…]} | Narrow to these topics → {"type":"subscribed"}. |
| you | {"type":"unsubscribe", "topics":[…]} | Drop some → {"type":"subscribed"}. |
| you | {"type":"topics"} | What is available and what you hear. |
| you | {"type":"ping"} | → {"type":"pong", "ts", "tick"}. |
| you | anything else | Echoed back as {"type":"echo"}; binary frames report their size. |
An unknown topic in ?topics= answers 400 before the upgrade, naming the ones that exist; in a subscribe message it answers {"type":"error"}.
Streams and topics
| API | Address | Topics |
|---|---|---|
| Store | wss://api.sondahub.com/v1/store/ws | orders 4 s · inventory 6 s |
| Fleet | wss://api.sondahub.com/v1/fleet/ws | telemetry 2 s · alerts ~15 s · devices ~10 s |
| Bank | wss://api.sondahub.com/v1/bank/ws | fx 1 s · transactions 3 s |
| Social | wss://api.sondahub.com/v1/social/ws | posts 5 s · likes 2 s |
| Helpdesk | wss://api.sondahub.com/v1/helpdesk/ws | tickets 5 s · messages 4 s |
| Flights | wss://api.sondahub.com/v1/flights/ws | board 3 s · bookings 6 s |
| Identity | wss://api.sondahub.com/v1/identity/ws | directory ~6 s · logins 2 s |
Questions
Is there a free public WebSocket echo server?
Yes: wss://api.sondahub.com/v1/utils/ws. Every frame you send comes straight back, text as text and binary as binary. It accepts the first subprotocol you offer, so a client that insists on one still connects. A plain HTTP request to the address answers 426 Upgrade Required.
Can two clients talk to each other through it?
No. sondahub keeps no shared state, so every connection is its own world: the echo answers you, and an API stream is generated for your connection alone. For a server that pushes on its own, use the API streams.
Does it work from a browser page?
Yes — WebSockets are not subject to CORS, and the server takes connections from any origin. The snippet above runs in any browser console.