WebSocket mock server
Updated Free mock REST & WebSocket APIs
Need a realtime backend for a chat, ticker or notification UI? Use the public echo server, or publish a scripted WebSocket mock that greets clients, pushes events on a timer and answers messages by pattern.
Echo server
const ws = new WebSocket("wss://mockfox.dev/api/ws/echo");
ws.onmessage = (e) => console.log("echo:", e.data);
ws.onopen = () => ws.send("hello");Open the echo server in the WebSocket tester →
Scripted WebSocket mock
Add a ws block to any mock. After publishing, connect to wss://mockfox.dev/api/ws/m/<id>.
✓ Valid — 1 resources, 0 custom routes, WebSocket script
Script reference
| Field | What it does |
|---|---|
onConnect | Messages sent as soon as a client connects |
interval | { everyMs, messages } — pushes the messages in a loop (min 1 s) |
replies | { match, reply } rules; match is a substring or /regex/flags |
echo | Echo messages that match no rule |
Related tools
Frequently asked questions
Is MockFox free?
Yes. No sign-up, no API key. Fair-use rate limits keep it fast for everyone, and clearly labeled sponsors pay for the servers.
What is the echo server URL?
wss://mockfox.dev/api/ws/echo — every text or binary message you send is sent straight back.
How long can a connection stay open?
Sessions close after 10 minutes; reconnect to continue. Messages are limited to 64 KB.
Can replies depend on the message?
Yes. Each reply rule matches a substring or a /regex/ and sends any JSON or text back.
Your business here? Sponsor this tool from $16/week. See placements