Configuration Reference

August 10, 2026 · View on GitHub

Configuration is passed as a dict in the hivemind-websocket-plugin block of ~/.config/hivemind-core/server.json. Dict keys always take precedence over environment variables.

Connection

KeyTypeDefaultDescription
hoststr0.0.0.0Bind address. Falls back to identity.default_master.
portint5678Listen port. Falls back to identity.default_port.
sslboolfalseEnable TLS (wss://).
cert_dirstr$XDG_DATA_HOME/hivemindDirectory for TLS cert/key files.
cert_namestrhivemindBase filename. It produces <name>.crt and <name>.key.

When ssl=true and the key file does not exist, a self-signed 2048-bit RSA certificate valid for 10 years is generated automatically.

There is no module key in network_protocol. hivemind-core reads every key of that block as a plugin entry-point name and starts each one, so a "module" key is looked up as a plugin named module; that entry fails to load and is logged, and the server still starts as long as another transport loads. agent_protocol, binary_protocol and database do use a module selector; this block does not.

Keepalive

KeyEnv varDefaultDescription
websocket_ping_intervalHIVEMIND_WEBSOCKET_PING_INTERVAL30.0Seconds between Tornado WebSocket keepalive pings. 0 disables them.
websocket_ping_timeoutHIVEMIND_WEBSOCKET_PING_TIMEOUT20.0Seconds to wait for a pong before Tornado closes the connection.

Both accept a number or a numeric string. A negative, non-finite or unparsable value is ignored with a warning and the default is used. These pings are Tornado's WebSocket-level keepalive; they are unrelated to the HiveMind PING message.

Trusted-proxy IP resolution

KeyEnv varDefaultDescription
trusted_proxy_cidrsHIVEMIND_TRUSTED_PROXY_CIDRS(none, feature disabled)Comma-separated CIDRs of trusted proxy addresses.
trusted_client_ip_headersHIVEMIND_TRUSTED_CLIENT_IP_HEADERSx-forwarded-for,x-real-ipOrdered list of headers to inspect for the real client IP.

Both keys accept a str, list, or tuple. Env vars accept comma-separated strings. The feature is inactive unless at least one CIDR is configured.

When inactive, remote_ip from the Tornado request is used as-is.

Example: nginx on localhost

export HIVEMIND_TRUSTED_PROXY_CIDRS="127.0.0.1/32"
export HIVEMIND_TRUSTED_CLIENT_IP_HEADERS="x-forwarded-for"

Example: private network proxies via config

{
  "network_protocol": {
    "hivemind-websocket-plugin": {
      "trusted_proxy_cidrs": ["10.0.0.0/8", "192.168.0.0/16"],
      "trusted_client_ip_headers": ["x-forwarded-for", "x-real-ip"]
    }
  }
}

See architecture.md for the full algorithm.

Full example

{
  "network_protocol": {
    "hivemind-websocket-plugin": {
      "host": "0.0.0.0",
      "port": 5678,
      "ssl": true,
      "cert_dir": "/etc/hivemind/ssl",
      "cert_name": "hivemind",
      "trusted_proxy_cidrs": ["127.0.0.1/32"],
      "trusted_client_ip_headers": ["x-forwarded-for"],
      "websocket_ping_interval": 30.0,
      "websocket_ping_timeout": 20.0
    }
  }
}

← Architecture · Home · Development →