Skip to content

Configuration reference ​

Everything is env-driven. In Laravel, publish config/surge.php to override defaults:

bash
php artisan vendor:publish --tag=surge-config

Options ​

Config keyEnv varDefaultDescription
hostSURGE_HOST0.0.0.0Bind address
portSURGE_PORT9019Bind port (WebSocket and HTTP API)
app.idSURGE_APP_ID → PUSHER_APP_IDsurgeApp id in the trigger URL
app.keySURGE_APP_KEY → PUSHER_APP_KEYsurge-keyPublic key used by Echo and the WS path
app.secretSURGE_APP_SECRET → PUSHER_APP_SECRETsurge-secretShared secret for signatures
activity_timeoutSURGE_ACTIVITY_TIMEOUT120Seconds before a client is asked to ping
client_eventsSURGE_CLIENT_EVENTStrueAllow client-* events on private/presence
limits.max_connectionsSURGE_MAX_CONNECTIONS10000Max concurrent connections (lite)
limits.max_message_bytesSURGE_MAX_MESSAGE_BYTES10485760Max single message size (10 MiB)
scaling.enabledSURGE_SCALING_ENABLEDfalseTurn on Redis pub/sub scaling
scaling.redis.hostSURGE_REDIS_HOST127.0.0.1Redis host
scaling.redis.portSURGE_REDIS_PORT6379Redis port
scaling.redis.prefixSURGE_REDIS_PREFIXsurgeKey/channel prefix

Two more settings are launch-time only (env, no config key):

Env varDefaultDescription
SURGE_RUNTIMEliteRuntime backend: lite or turbo
SURGE_LOG_FORMATtextLog output: text (human) or json (structured)

A Prometheus metrics endpoint is served at GET /metrics — see Deployment → Observability.

The runtime (lite / turbo) is selected at launch — see the CLI reference (--runtime / SURGE_RUNTIME).

The published config file ​

php
return [
    'host' => env('SURGE_HOST', '0.0.0.0'),
    'port' => (int) env('SURGE_PORT', 9019),

    'app' => [
        'id'     => env('SURGE_APP_ID', env('PUSHER_APP_ID', 'surge')),
        'key'    => env('SURGE_APP_KEY', env('PUSHER_APP_KEY', 'surge-key')),
        'secret' => env('SURGE_APP_SECRET', env('PUSHER_APP_SECRET', 'surge-secret')),
    ],

    'activity_timeout' => (int) env('SURGE_ACTIVITY_TIMEOUT', 120),
    'client_events'    => (bool) env('SURGE_CLIENT_EVENTS', true),

    'limits' => [
        'max_connections'   => (int) env('SURGE_MAX_CONNECTIONS', 10000),
        'max_message_bytes' => (int) env('SURGE_MAX_MESSAGE_BYTES', 10 * 1024 * 1024),
    ],

    'scaling' => [
        'enabled' => (bool) env('SURGE_SCALING_ENABLED', false),
        'redis'   => [
            'host'   => env('SURGE_REDIS_HOST', '127.0.0.1'),
            'port'   => (int) env('SURGE_REDIS_PORT', 6379),
            'prefix' => env('SURGE_REDIS_PREFIX', 'surge'),
        ],
    ],
];

Match your credentials

app.id, app.key, and app.secret must match the pusher connection in config/broadcasting.php and the Echo config on the frontend.

Released under the MIT License.