Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@socketo/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@socketo/cli
Local Pusher-compatible WebSocket server. Drop-in replacement for Pusher Channels during development — same protocol, zero config, no API key needed.
Built on Miniflare and Cloudflare Durable Objects, using the WebSocket Standard API for persistent in-memory state.
npx @socketo/cli startServer listens at ws://localhost:8787.
Usage
npx @socketo/cli start [options]
-p, --port <port> Port (default: 8787)
--webhook-url <url> Webhook URL for server-side callbacks
--webhook-secret <secret> HMAC secret for webhook signaturesClient SDK
// Client
import PusherJS from 'pusher-js'
const pusher = new Pusher('local', {
wsHost: 'localhost',
wsPort: 8787,
forceTLS: false,
enabledTransports: ['ws'],
cluster: 'local',
})Server SDK
import Pusher from 'pusher'
const server = new Pusher({
appId: 'local',
key: 'local',
secret: 'local',
host: 'localhost:8787',
useTLS: false,
})
server.trigger('my-channel', 'my-event', { hello: 'world' })Supported
WebSocket Protocol
pusher:connection_establishedhandshake- Subscribe / unsubscribe (public, private, presence)
- Client events (
client-*) - Ping / pong
Presence Channels
channel_datawithuser_idanduser_infopusher_internal:subscription_succeededwith member listmember_added/member_removedevents
REST API
| Method | Path | Description |
|---|---|---|
POST |
/apps/local/events |
Trigger events |
POST |
/apps/local/batch_events |
Trigger up to 10 events |
GET |
/apps/local/channels |
List channels |
GET |
/apps/local/channels/{name} |
Channel info |
GET |
/apps/local/channels/{name}/users |
Presence users |
POST |
/apps/local/users/{id}/terminate_connections |
Disconnect user |
Query params: ?filter_by_prefix= and ?info=user_count,subscription_count.
Webhooks
POST to your URL when channels are occupied/vacated, members join/leave, or client events fire. Payload matches Pusher's webhook format with X-Pusher-Key and X-Pusher-Signature headers.
State
Connection state survives indefinitely (no hibernation). Channels, members, and user data persist across requests.
CORS
All HTTP endpoints return Access-Control-Allow-Origin: *.
Not Supported
- Authentication (auth signatures, body_md5)
- Encrypted channels (E2E)
- Cache channels
- TLS / WSS