Docs/CLI & Self-Hosting
Socketo CLI
Standalone local Pusher-compatible WebSocket server and CLI reference.
Overview
The @socketo/cli package is a zero-dependency, local Pusher-compatible WebSocket and REST server designed for development and automated testing environments.
Installation & Execution
Run instantly without local installation:
bash
npx @socketo/cli startSubcommands
| Command | Description |
|---|---|
start | Launches the local WebSocket and REST server (default port 8787). |
trigger <channel> <event> [data] | Publishes an event directly to a local or remote channel. |
repl | Opens an interactive terminal session for inspecting connections and channels. |
CLI Options (start)
| Option | Alias | Default | Description |
|---|---|---|---|
--port | -p | 8787 | Port to bind the HTTP and WebSocket server. |
--host | -H | 127.0.0.1 | Network interface to bind. |
--key | -k | local | Accepted application key. |
--secret | -s | local | Accepted application HMAC secret. |
--webhook | -w | — | Target HTTP URL for outbound webhook delivery. |
--webhook-events | — | * | Comma-delimited list of subscribed webhook events. |
--disable-client-events | — | false | Disallow client-* events from connected clients. |
Local Webhook Testing Example
bash
npx @socketo/cli start -w http://localhost:3000/api/webhooks --webhook-events channel_occupied,channel_vacated,client_event