Server
Configuration
Server config structure, load order, and runtime defaults.
Config Sources and Priority
Sockudo applies configuration in this order:
- Internal defaults.
config/config.json(if present).- CLI
--configfile. - Environment variables (highest priority).
Core Config Shape
Main config object groups:
| Section | Purpose |
|---|---|
adapter | Pub/sub transport (local, redis, redis-cluster, nats) |
app_manager | App credential source (memory, mysql, postgres, dynamodb, scylladb) |
cache | Cache backend (memory, redis, redis-cluster, none) |
queue | Queue backend (memory, redis, redis-cluster, sqs, none) |
rate_limiter | Rate limiting backend and rules |
database | MySQL, PostgreSQL, Redis, DynamoDB, ScyllaDB connection settings |
database_pooling | Global connection pool settings |
metrics | Prometheus metrics endpoint |
cors | Cross-origin resource sharing |
ssl | TLS termination |
unix_socket | Unix domain socket listener |
webhooks | Webhook delivery and batching |
cleanup | Async disconnect processing |
cluster_health | Multi-node health monitoring |
delta_compression | Delta compression for repeated messages |
tag_filtering | Tag-based message filtering |
websocket | WebSocket buffer and protocol settings |
channel_limits | Channel name and cache limits |
event_limits | Event size and batch limits |
presence | Presence channel limits |
http_api | HTTP API request limits |
logging | Log output formatting |
Minimal starter:
config/config.json
{
"host": "0.0.0.0",
"port": 6001,
"adapter": { "driver": "local" },
"app_manager": {
"driver": "memory",
"array": {
"apps": [
{
"id": "app-id",
"key": "app-key",
"secret": "app-secret",
"enabled": true,
"enable_client_messages": true,
"max_connections": 100000,
"max_client_events_per_second": 1000
}
]
}
},
"metrics": { "enabled": true, "port": 9601 }
}
App-Level Limits
Per-app settings control behavior and protection boundaries:
| Setting | Default | Description |
|---|---|---|
max_connections | 100 | Max simultaneous connections |
max_client_events_per_second | 100 | Client event rate |
max_read_requests_per_second | 100 | Read request rate |
max_backend_events_per_second | 100 | Backend event rate |
max_presence_members_per_channel | 100 | Max presence members |
max_presence_member_size_in_kb | 100 | Max presence member data |
max_channel_name_length | 100 | Max channel name length |
max_event_channels_at_once | 100 | Max channels per broadcast |
max_event_name_length | 100 | Max event name length |
max_event_payload_in_kb | 100 | Max event payload |
max_event_batch_size | 100 | Max events per batch |
enable_client_messages | false | Allow client-to-client events |
enable_user_authentication | false | Require user auth |
enable_watchlist_events | false | Enable watchlist events |
allowed_origins | null | Restrict WebSocket origins |
channel_delta_compression | null | Per-channel delta config |
CLI Configuration File Override
Terminal
./sockudo --config ./config/production.json
or:
Terminal
cargo run --release -- --config ./config/production.json
Defaults Worth Knowing
| Setting | Default |
|---|---|
| HTTP/WebSocket port | 6001 |
| Metrics port | 9601 |
| Activity timeout | 120s |
| Shutdown grace period | 10s |
| User auth timeout | 3600s |
| WebSocket max payload | 64 KB |
| Delta compression | enabled (fossil) |
| Tag filtering | disabled |
| WebSocket buffer | max_messages=1000 |
| Rate limiter | enabled (memory backend) |
| Database pooling | enabled (min=2, max=10) |
| Webhook batching | enabled (50ms window) |
| Async cleanup | enabled |
| Cluster health | enabled |
See Config Reference for the complete JSON structure and Environment Variables for all env var overrides.