Sockudo
Server

Configuration

Server config structure, load order, and runtime defaults.

Config Sources and Priority

Sockudo applies configuration in this order:

  1. Internal defaults.
  2. config/config.json (if present).
  3. CLI --config file.
  4. Environment variables (highest priority).

Core Config Shape

Main config object groups:

SectionPurpose
adapterPub/sub transport (local, redis, redis-cluster, nats)
app_managerApp credential source (memory, mysql, postgres, dynamodb, scylladb)
cacheCache backend (memory, redis, redis-cluster, none)
queueQueue backend (memory, redis, redis-cluster, sqs, none)
rate_limiterRate limiting backend and rules
databaseMySQL, PostgreSQL, Redis, DynamoDB, ScyllaDB connection settings
database_poolingGlobal connection pool settings
metricsPrometheus metrics endpoint
corsCross-origin resource sharing
sslTLS termination
unix_socketUnix domain socket listener
webhooksWebhook delivery and batching
cleanupAsync disconnect processing
cluster_healthMulti-node health monitoring
delta_compressionDelta compression for repeated messages
tag_filteringTag-based message filtering
websocketWebSocket buffer and protocol settings
channel_limitsChannel name and cache limits
event_limitsEvent size and batch limits
presencePresence channel limits
http_apiHTTP API request limits
loggingLog 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:

SettingDefaultDescription
max_connections100Max simultaneous connections
max_client_events_per_second100Client event rate
max_read_requests_per_second100Read request rate
max_backend_events_per_second100Backend event rate
max_presence_members_per_channel100Max presence members
max_presence_member_size_in_kb100Max presence member data
max_channel_name_length100Max channel name length
max_event_channels_at_once100Max channels per broadcast
max_event_name_length100Max event name length
max_event_payload_in_kb100Max event payload
max_event_batch_size100Max events per batch
enable_client_messagesfalseAllow client-to-client events
enable_user_authenticationfalseRequire user auth
enable_watchlist_eventsfalseEnable watchlist events
allowed_originsnullRestrict WebSocket origins
channel_delta_compressionnullPer-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

SettingDefault
HTTP/WebSocket port6001
Metrics port9601
Activity timeout120s
Shutdown grace period10s
User auth timeout3600s
WebSocket max payload64 KB
Delta compressionenabled (fossil)
Tag filteringdisabled
WebSocket buffermax_messages=1000
Rate limiterenabled (memory backend)
Database poolingenabled (min=2, max=10)
Webhook batchingenabled (50ms window)
Async cleanupenabled
Cluster healthenabled

See Config Reference for the complete JSON structure and Environment Variables for all env var overrides.

Copyright © 2026