Reference

Caddy Reference

Directive overview for Queue, Scheduler, Pogo, and WebSocket.

Queue

pogo_queue is a global Caddy option.

Caddyfile
{
  pogo_queue {
    backend redis {
      url {$POGO_REDIS_URL}
    }

    worker public/queue-worker.php
  }
}
DirectiveDefaultDescription
backend redisredisDurable Redis Streams backend.
backend memorynoneLocal demo backend only.
workerqueue-worker.phpPHP worker script.
queuesdefaultComma or space separated queue names.
concurrency1Number of queue reserve loops.
worker_threadsconcurrencyFrankenPHP worker thread count.
max_payload_bytes1048576Maximum job payload size.
visibility_timeout90sTime before a pending job can be reclaimed.
reserve_timeout1sBlocking reserve timeout.
shutdown_timeout30sGrace period for queue loop shutdown.
max_attempts3Attempts before failed stream/dead-letter behavior.

Redis backend directives:

DirectiveDefaultDescription
urlPOGO_REDIS_URLRedis URL. Required if env var is absent.
key_prefixpogoRedis key prefix.
groupdefaultRedis consumer group.
consumerhostname and process idBase consumer name.
tlsfalseEnables TLS for Redis connection.

Memory backend directives:

DirectiveDefaultDescription
max_messages1000Maximum in-memory messages.
max_total_bytes67108864Maximum total payload bytes.

Scheduler

pogo_scheduler is a global Caddy option.

Caddyfile
{
  pogo_scheduler {
    command php artisan schedule:run
    dir /var/www/html
    timeout 5m
    overlap allow
    shutdown_grace 30s
  }
}
DirectiveDefaultDescription
commandphp artisan schedule:runCommand and arguments.
diremptyOptional working directory.
timeout5mMax duration per command run.
overlapallowallow or skip.
shutdown_grace30sGrace period before cancelling active commands.

Pogo

pogo is a global Caddy option.

Caddyfile
{
  pogo {
    pool default {
      worker public/pogo-worker.php
      num_threads 8
      max_wait 30s
    }
  }
}
DirectiveRequiredDescription
poolYesDefines a named worker pool. A default pool is required.
workerYesPHP worker script for the pool.
num_threadsNoFrankenPHP worker thread count.
max_waitNoMaximum SendMessage wait. Defaults to 30s.

WebSocket

pogo_websocket is an HTTP handler directive. Place it before php_server for the WebSocket route.

Caddyfile
route /app/* {
  pogo_websocket {
    app_id pogo-app
    app_secret {$WS_APP_SECRET}
    auth_path /pogo/auth
    auth_script public/websocket-worker.php
  }
}

Required directives:

DirectiveDescription
app_idPusher app id / key.
app_secretShared secret. May be resolved from WS_APP_SECRET_<APP_ID> or WS_APP_SECRET.
auth_pathAuth endpoint path.
auth_scriptPHP auth worker script.

Common optional directives:

DirectiveDefaultDescription
num_workers2Dedicated PHP auth workers.
max_connections10000Max concurrent clients.
max_auth_body16384Max PHP auth response body size.
max_concurrent_auth100Auth concurrency guard.
num_shardsCPU basedInternal hub shard count.
handshake_rate100Connection attempts per second per direct remote IP.
handshake_burst50Handshake burst allowance.
allowed_originssame host policyExact http:// or https:// origins.
broker_queue_sizedelivery defaultInternal broker queue size.
shard_queue_sizedelivery defaultPer-shard queue size.
outbound_queue_sizedelivery defaultPer-client outbound queue size.
write_burst_sizedelivery defaultPer-client write burst size.
client_msg_rate_limitmodule defaultClient event rate limit.
client_msg_rate_burstmodule defaultClient event burst.
enable_compressionfalseWebSocket compression.
ping_periodmodule defaultServer ping interval.
pong_waitmodule defaultClient pong timeout.
write_waitmodule defaultSocket write timeout.
shutdown_timeoutmodule defaultGraceful shutdown timeout.
webhook_urlemptyBest-effort webhook target.
webhook_secretemptyWebhook signing secret.
redis_hostemptyEnables Redis Pub/Sub broker.
redis_passwordemptyRedis password.
redis_db0Redis database.
redis_tlsfalseRedis TLS.