HookSocket — A serverless WebSocket-to-HTTP bridge for real-time automations, chatbots, IoT, and more. Powered by Cloudflare Workers.
HookSocket is a lightweight, serverless WebSocket bridge that forwards WebSocket messages to HTTP endpoints (like webhooks) — and vice versa.
- Enables full WebSocket support in tools like n8n, Make.com or Zapier but also for any other custom Server implementation
- Works serverlessly on Cloudflare Workers (free, scalable, no infra to manage).
- Real-time 2-way communication with dynamic WebSocket rooms, isolated by
<roomId>.
Perfect for building chatbot frontends, real-time dashboards, alerts, and more — using webhook-based backends.
HookSocket enables two-way communication:
The WebSocket Client sends a message → HookSocket forwards it to a Webhook URL.
WebSocket Client
|
| {"msg": Hello!"} [Message to wss://hooksocket.workers.dev/websocket/<roomId>]
↓
HookSocket
|
| {"msg": Hello!"} [POST to https://your-webhook.com/webhook/<roomId>]
↓
Your Webhook URL
⚠️ Note that the Payload will be forwarded as is, no modifications will be made.
Your Workflow/Server sends an HTTP POST → HookSocket forwards it to the WebSocket client(s).
Your Workflow/Server
|
| {"msg": "How are you?"} [POST to https://hooksocket.workers.dev/webhook/<roomId>]
↓
HookSocket
|
| {"msg": "How are you?"} [Message to wss://hooksocket.workers.dev/websocket/<roomId>]
↓
WebSocket Client
-
Deploy HookSocket:
and note the domain, e.g.
hooksocket.workers.dev -
Open Postman and set the request type to "WebSocket". Connect to
wss://hooksocket.workers.dev/websocket/test. -
Open another Postman Tab and set the request type to "HTTP". Send a POST request to
https://hooksocket.workers.dev/websocket/testwith any JSON or Text payload. -
Switch back to the "WebSocket" Tab and you will see that your payload has been received.
✅ You can open multiple WebSocket Tabs, all of them will receive the same message
⚠️ You can have unlimited rooms, theroomIdin this case istest
You can configure HookSocket to fit your needs. All variables are optional (defaults apply).
| Variable | Default | Description |
|---|---|---|
WS_PATH |
/websocket/ |
WebSocket path prefix |
WH_PATH |
/webhook/ |
Webhook path prefix |
WH_HOST |
(request hostname) | Optional override of the target HTTP host |
⚠️ Adjust your CF Workers environment variables in the Settings
If you have a self-hosted n8n instance, and you use Cloudflare anyway, you can create a new route, so it looks like a n8n Endpoint:
- Open the CF Worker Settings
- Add a new route
https://your-n8n-domain.com/websocket/*
Now your Clients can connect to wss://your-n8n-domain.com/websocket/<roomId> and your n8n workflow can send requests to https://your-n8n-domain.com/websocket/<roomId> 🥳
MIT License — free to use and modify.