Skip to content

Server options reference (anycable-go)

Every command-line option and environment variable for the anycable-go server, grouped by area. Generated from anycable-go --help (OSS v1.6.14), with Pro-only options listed separately.

For prose explanations of the most common options, see Configuration. This page is the complete, flat list, handy as a lookup and for agents.

Every option can be set three ways: a command-line flag (--port 8080), an environment variable (the Env column, e.g. ANYCABLE_PORT=8080), or a key in a TOML config file (--config-path). Options marked Value take an argument. Run anycable-go --help for the list matching your installed version.

Global

OptionValueEnvDefaultDescription
--config-pathyesPath to the TOML configuration file
--help, -hshow help
--ignore-config-pathfalseIgnore configuration files
--print-configfalsePrint configuration and exit
--version, -vprint the version
--ws_max_pending_sizeyes1048576Maximum size (in bytes) of the write queue for a session before it's considered slow and disconnected (0 = unlimited)

AnyCable-Go Server

OptionValueEnvDefaultDescription
--allowed_originsyesANYCABLE_ALLOWED_ORIGINSAccept requests only from specified origins, e.g., "www.example.com,*example.io". No check is performed if empty
--broadcast_keyyesANYCABLE_BROADCAST_KEYAn authentication key for broadcast requests
--health-pathyesANYCABLE_HEALTH_PATH"/health"HTTP health endpoint path
--hostyesANYCABLE_HOST"localhost"Server host
--max-connyesANYCABLE_MAX_CONN0Limit simultaneous server connections (0 – without limit)
--noauthANYCABLE_NOAUTHfalse[DANGER ZONE] Disable client authentication over RPC
--pathyesANYCABLE_PATH"/cable"WebSocket endpoint path (you can specify multiple paths using comma as separator)
--portyesANYCABLE_PORT, $PORT8080Server port
--publicANYCABLE_PUBLICfalse[DANGER ZONE] Run server in the public mode allowing all connections and stream subscriptions
--secretyesANYCABLE_SECRETA common secret key used by all features by default
--shutdown_delayyesANYCABLE_SHUTDOWN_DELAY0Sleep time before shutting down (in seconds)
--shutdown_timeoutyesANYCABLE_SHUTDOWN_TIMEOUT30Graceful shutdown timeout (in seconds)

API

OptionValueEnvDefaultDescription
--api_pathyesANYCABLE_API_PATH"/api"API endpoint base path
--api_portyesANYCABLE_API_PORT0API server port (0 = use main server port)
--api_secretyesANYCABLE_API_SECRETSecret token to authenticate API requests

Broadcasting

OptionValueEnvDefaultDescription
--broadcast_adapteryesANYCABLE_BROADCAST_ADAPTERBroadcasting adapter to use (http, redisx, redis or nats). You can specify multiple at once via a comma-separated list
--brokeryesANYCABLE_BROKERBroker engine to use (memory)
--nats_channelyesANYCABLE_NATS_CHANNEL"__anycable__"NATS channel for broadcasts
--pubsubyesANYCABLE_PUBSUBPub/Sub adapter to use (redis or nats)
--redis_channelyesANYCABLE_REDIS_CHANNEL"__anycable__"Redis channel for broadcasts

Broker

OptionValueEnvDefaultDescription
--history_limityesANYCABLE_HISTORY_LIMIT100Max number of messages to keep in the stream's history
--history_ttlyesANYCABLE_HISTORY_TTL300TTL for messages in streams history (seconds)
--presence_ttlyesANYCABLE_PRESENCE_TTL15TTL for presence information (seconds)
--sessions_ttlyesANYCABLE_SESSIONS_TTL300TTL for expired/disconnected sessions (seconds)

Disconnector

OptionValueEnvDefaultDescription
--disconnect_modeyesANYCABLE_DISCONNECT_MODE"auto"Define when to call Disconnect callback (always, never, auto)

Durable Streams

OptionValueEnvDefaultDescription
--dsANYCABLE_DSfalseEnable Durable Streams endpoint
--ds_pathyesANYCABLE_DS_PATH"/ds"Durable Streams endpoint path
--ds_poll_intervalyesANYCABLE_DS_POLL_INTERVAL10Durable Streams long polling interval (seconds)
--ds_skip_authANYCABLE_DS_SKIP_AUTHfalseDisable client authentication for Durable Streams (only authorize stream access)
--ds_sse_ttlyesANYCABLE_DS_SSE_TTL60Durable Streams SSE connections time-to-live (seconds)

Embedded NATS

OptionValueEnvDefaultDescription
--embed_natsANYCABLE_EMBED_NATSfalseEnable embedded NATS server and use it for pub/sub
--enats_cluster_nameyesANYCABLE_ENATS_CLUSTER_NAME"anycable-cluster"NATS cluster name
--enats_cluster_routesyesANYCABLE_ENATS_CLUSTER_ROUTESComma-separated list of known cluster addresses
--enats_gateway_advertiseyesANYCABLE_ENATS_GATEWAY_ADVERTISENATS gateway advertise address
--enats_gatewaysyesANYCABLE_ENATS_GATEWAYSSemicolon-separated list of known gateway configurations: name_a:gateway_1,gateway_2;name_b:gateway_4
--enats_max_payloadyesANYCABLE_ENATS_MAX_PAYLOAD0Maximum message payload size in bytes (0 uses the NATS default of 1MB)
--enats_server_nameyesANYCABLE_ENATS_SERVER_NAMEEmbedded NATS unique server name (required for JetStream), auto-generated by default

HTTP Broadcast

OptionValueEnvDefaultDescription
--http_broadcast_pathyesANYCABLE_HTTP_BROADCAST_PATH"/_broadcast"HTTP pub/sub endpoint path
--http_broadcast_portyesANYCABLE_HTTP_BROADCAST_PORT0HTTP pub/sub server port

JWT

OptionValueEnvDefaultDescription
--enforce_jwtANYCABLE_ENFORCE_JWTfalseWhether to enforce token presence for all connections
--jwt_paramyesANYCABLE_JWT_PARAM"jid"The name of a query string param or an HTTP header carrying a token
--jwt_secretyesANYCABLE_JWT_SECRETThe encryption key used to verify JWT tokens

Log

OptionValueEnvDefaultDescription
--debugANYCABLE_DEBUGfalseEnable debug mode (more verbose logging)
--log_formatyesANYCABLE_LOG_FORMAT"text"Set logging format (text/json)
--log_levelyesANYCABLE_LOG_LEVEL"info"Set logging level (debug/info/warn/error)

Metrics

OptionValueEnvDefaultDescription
--metrics_hostyesANYCABLE_METRICS_HOSTServer host for metrics endpoint
--metrics_httpyesANYCABLE_METRICS_HTTPEnable HTTP metrics endpoint at the specified path
--metrics_logANYCABLE_METRICS_LOGfalseEnable metrics logging (with info level)
--metrics_log_filteryesANYCABLE_METRICS_LOG_FILTERSpecify list of metrics to print to log (to reduce the output)
--metrics_portyesANYCABLE_METRICS_PORT0Server port for metrics endpoint, the same as for main server by default
--metrics_rotate_intervalyesANYCABLE_METRICS_ROTATE_INTERVAL15Specify how often flush metrics to writers (logs, statsd) (in seconds)
--metrics_tagsyesANYCABLE_METRICS_TAGSComma-separated list of default (global) tags to add to every metric
--stats_refresh_intervalyesANYCABLE_STATS_REFRESH_INTERVAL5How often to refresh the server stats (in seconds)

Misc

OptionValueEnvDefaultDescription
--presetsyesANYCABLE_PRESETSConfiguration presets, comma-separated (none, fly, heroku, broker). Inferred automatically

NATS

OptionValueEnvDefaultDescription
--nats_serversyesANYCABLE_NATS_SERVERS"nats://127.0.0.1:4222"Comma separated list of NATS cluster servers

Ping

OptionValueEnvDefaultDescription
--enable_native_pingsANYCABLE_ENABLE_NATIVE_PINGSfalseSend native pings (e.g., WebSocket ping frames) along with application-level pings to keepalive clients using custom protocols
--ping_intervalyesANYCABLE_PING_INTERVAL3Action Cable ping interval (in seconds)
--pong_timeoutyesANYCABLE_PONG_TIMEOUT0How long to wait for a pong response before disconnecting the client (in seconds). Zero means no pongs required

Pusher

OptionValueEnvDefaultDescription
--pusher_api_portyesANYCABLE_PUSHER_API_PORT0Port for Pusher HTTP API (0 = use the main server port)
--pusher_app_idyesANYCABLE_PUSHER_APP_IDPusher application ID
--pusher_app_keyyesANYCABLE_PUSHER_APP_KEYPusher application key
--pusher_secretyesANYCABLE_PUSHER_SECRETPusher secret

Redis X Broadcast

OptionValueEnvDefaultDescription
--redisx_streamyesANYCABLE_REDISX_STREAM"__anycable__"Redis X broadcaster stream name

Redis

OptionValueEnvDefaultDescription
--redis_sentinelsyesANYCABLE_REDIS_SENTINELSComma separated list of sentinel hosts, format: 'hostname:port,..'
--redis_tls_ca_cert_pathyesANYCABLE_REDIS_TLS_CA_CERT_PATHPath to the CA certificate file to verify the Redis server certificate
--redis_tls_client_cert_pathyesANYCABLE_REDIS_TLS_CLIENT_CERT_PATHPath to the client TLS certificate file for mutual TLS with Redis
--redis_tls_client_key_pathyesANYCABLE_REDIS_TLS_CLIENT_KEY_PATHPath to the client TLS private key file for mutual TLS with Redis
--redis_urlyesANYCABLE_REDIS_URL, $REDIS_URL"redis://localhost:6379"Redis url

RPC

OptionValueEnvDefaultDescription
--headersyesANYCABLE_HEADERS"cookie"List of headers to proxy to RPC
--http_rpc_secretyesANYCABLE_HTTP_RPC_SECRETAuthentication secret for RPC over HTTP
--norpcANYCABLE_NORPCfalseDisable RPC component and run server in the standalone mode
--proxy-cookiesyesANYCABLE_PROXY_COOKIESCookie keys to send to RPC, default is all
--rpc_concurrencyyesANYCABLE_RPC_CONCURRENCY28Max number of concurrent RPC request; should be slightly less than the RPC server concurrency
--rpc_hostyesANYCABLE_RPC_HOST"localhost:50051"RPC service address (full URL in case of HTTP RPC)
--rpc_request_timeoutyesANYCABLE_RPC_REQUEST_TIMEOUT0RPC requests timeout (in ms)

Server-Sent Events

OptionValueEnvDefaultDescription
--sseANYCABLE_SSEfalseEnable SSE endpoint
--sse_pathyesANYCABLE_SSE_PATH"/events"SSE endpoint path

Signed Streams

OptionValueEnvDefaultDescription
--cable_readyANYCABLE_CABLE_READYfalseEnable Cable Ready support
--cable_ready_secretyesANYCABLE_CABLE_READY_SECRETA custom secret to verify CableReady streams
--public_streamsANYCABLE_PUBLIC_STREAMSfalseEnable public (unsigned) streams
--streams_presenceANYCABLE_STREAMS_PRESENCEtrueEnable presence for signed pub/sub streams
--streams_secretyesANYCABLE_STREAMS_SECRETSecret you use to sign stream names
--streams_whisperANYCABLE_STREAMS_WHISPERfalseEnable whispering for signed pub/sub streams
--turbo_streamsANYCABLE_TURBO_STREAMSfalseEnable Turbo Streams support
--turbo_streams_secretyesANYCABLE_TURBO_STREAMS_SECRETA custom secret to verify Turbo Streams

SSL

OptionValueEnvDefaultDescription
--ssl_certyesANYCABLE_SSL_CERTSSL certificate path
--ssl_keyyesANYCABLE_SSL_KEYSSL private key path

StatsD

OptionValueEnvDefaultDescription
--statsd_hostyesANYCABLE_STATSD_HOSTServer host for metrics sent to statsd server in the format <host>:<port>
--statsd_prefixyesANYCABLE_STATSD_PREFIX"anycable_go."Statsd metrics prefix
--statsd_tags_formatyesANYCABLE_STATSD_TAGS_FORMAT"datadog"One of "datadog", "influxdb", or "graphite"

WebSockets

OptionValueEnvDefaultDescription
--ws_write_timeoutyesANYCABLE_WS_WRITE_TIMEOUT2Maximum time to wait for a write operation to complete

Pro-only options

These options are available in AnyCable Pro and AnyCable+, on top of everything above. Generated from a Pro build (1.6.14-pro).

OptionValueEnvDefaultDescription
--adminANYCABLE_ADMINfalseEnable admin console
--admin_pathyesANYCABLE_ADMIN_PATH"/_high_voltage_"Admin console HTTP root
--admin_portyesANYCABLE_ADMIN_PORT0Admin console server port (set to 0 to run on the same port as the main server)
--admin_secretyesANYCABLE_ADMIN_SECRETAuthentication secret for admin actions
--graphql_actionyesANYCABLE_GRAPHQL_ACTION"execute"GraphQL Ruby channel action (method) name
--graphql_channelyesANYCABLE_GRAPHQL_CHANNEL"GraphqlChannel"GraphQL Ruby channel class name
--graphql_idle_timeoutyesANYCABLE_GRAPHQL_IDLE_TIMEOUT2Defines for how long to wait for connection_init (in seconds)
--graphql_pathyesANYCABLE_GRAPHQL_PATHEnable GraphQL proxy and mount at the specified path
--pollANYCABLE_POLLfalseEnable long polling support
--poll_flush_intervalyesANYCABLE_POLL_FLUSH_INTERVAL500Long polling flush interval (in milliseconds)
--poll_intervalyesANYCABLE_POLL_INTERVAL15Long polling interval (in seconds)
--poll_keepalive_timeoutyesANYCABLE_POLL_KEEPALIVE_TIMEOUT5Long polling keepalive timeout (in seconds)
--poll_max_request_sizeyesANYCABLE_POLL_MAX_REQUEST_SIZE65536Long polling maximum request body size (in bytes)
--poll_pathyesANYCABLE_POLL_PATH"/lp"Long polling endpoint path
--ocpp_channelyesANYCABLE_OCPP_CHANNEL"OCPPChannel"OCPP Action Cable channel class name
--ocpp_granular_actionsANYCABLE_OCPP_GRANULAR_ACTIONStrueTranslate each OCPP command into its own action
--ocpp_heartbeat_intervalyesANYCABLE_OCPP_HEARTBEAT_INTERVAL30Default heartbeat interval in seconds. Note: current Pro builds (≤ 1.6.14-pro) spell this --ocpp_hearbeat_interval / ANYCABLE_OCPP_HEARBEAT_INTERVAL (a known typo); use that spelling until the fix ships.
--ocpp_pathyesANYCABLE_OCPP_PATHWebSocket endpoint path prefix to accept OCPP connections
--rpc_concurrency_initialyesANYCABLE_RPC_CONCURRENCY_INITIAL25Initial concurrency (adaptive)
--rpc_concurrency_maxyesANYCABLE_RPC_CONCURRENCY_MAX100Max concurrency (adaptive)
--rpc_concurrency_minyesANYCABLE_RPC_CONCURRENCY_MIN5Min concurrency (adaptive)
--shutdown_slowdrainANYCABLE_SHUTDOWN_SLOWDRAINfalseEnable slow draining of connections during shutdown
--netpoll_enabledANYCABLE_NETPOLL_ENABLEDtrueWhether to use net polling (epoll, kqueue)