Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sockudo/sockudo/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Sockudo implements the Pusher Protocol v7, providing full compatibility with Pusher client libraries and APIs. This means you can use existing Pusher SDKs (JavaScript, iOS, Android, etc.) with Sockudo without modification.Protocol Constants
WebSocket Connection
Connection URL
Clients connect to Sockudo using a WebSocket URL with the app key:Connection Established
Upon successful connection, the server sends apusher:connection_established event:
socket_id uniquely identifies this connection and is used for authentication and excluding messages from the sender.
Message Format
Base Message Structure
All messages exchanged between client and server follow this structure:Message Data Types
Thedata field can be:
-
String - JSON-encoded string
-
Structured - Object with specific fields
-
Raw JSON - Direct JSON value
Standard Events
Connection Events
pusher:connection_established Sent when client connects successfully. pusher:error Sent when an error occurs.Subscription Events
pusher:subscribe Client requests to join a channel.Presence Events
pusher_internal:member_added New member joins a presence channel.Client Events
Clients can trigger events on private and presence channels (prefixed withclient-):
Client events are only allowed on
private-* and presence-* channels for security reasons.HTTP API
Sockudo provides a REST API compatible with Pusher’s HTTP API for triggering events:Trigger Event
POST/apps/{app_id}/events
Batch Events
POST/apps/{app_id}/batch_events
Channel Information
GET/apps/{app_id}/channels
Returns list of active channels.
GET /apps/{app_id}/channels/{channel_name}
Returns information about a specific channel:
Presence Channel Users
GET/apps/{app_id}/channels/{channel_name}/users
Terminate User Connections
POST/apps/{app_id}/users/{user_id}/terminate_connections
Disconnects all connections for a specific user.
Sockudo Extensions
Sockudo adds several protocol extensions while maintaining backward compatibility:Delta Compression
Reduce bandwidth by sending only message differences:Tag Filtering
Server-side message filtering based on tags:Cache Channels
Channels with#cache prefix support persistent data:
Error Codes
Sockudo uses standard Pusher error codes:| Code | Description |
|---|---|
| 4000 | Application only accepts SSL connections |
| 4001 | Application does not exist |
| 4003 | Application disabled |
| 4004 | Application over connection quota |
| 4005 | Path not found |
| 4006 | Invalid version string format |
| 4007 | Unsupported protocol version |
| 4008 | No protocol version supplied |
| 4009 | Connection is unauthorized |
| 4100 | Over capacity (slow consumer) |
| 4200 | Generic error |
| 4201 | Pong reply not received in time |
| 4202 | Closed after inactivity |
| 4301 | Client sent message too large |
Protocol Validation
Channel Names
- Maximum 200 characters
- Allowed characters:
a-zA-Z0-9_\-=@,.; - Special prefixes:
private-- Private channelspresence-- Presence channelsprivate-encrypted-- End-to-end encrypted channels#cache- Cache channels
Event Names
- Maximum 200 characters
client-prefix reserved for client-triggered eventspusher:andpusher_internal:prefixes reserved for system events
Next Steps
Channels
Learn about different channel types
Authentication
Secure private and presence channels
Client Libraries
Connect with Pusher-compatible SDKs
HTTP API
Trigger events via REST API