Maximum concurrent connections from one client address; 0 disables the limit. IPv6 clients are grouped by /64. Must not exceed max_connections. Set it low enough to stop one source exhausting max_connections, but account for clients behind NAT sharing one address.
handshake_timeout_ms
integer
10000
Timeout for SOCKS5 handshake.
allow_unsafe_public_proxy
bool
false
Allow a no-auth SOCKS listener on a non-loopback address. Startup fails closed unless this is set explicitly.
Brute-force protection. For userpass and pam.username, a source address that fails authentication 10 times within 60 seconds is locked out for the rest of that window: further attempts are rejected without checking credentials (and, for PAM, without calling PAM). A successful login clears the counter. Only genuine credential failures count; PAM or system faults do not. The tracking table is bounded (65,536 addresses). Failures are exported as rustsocks_socks_auth_failures_total{method}; see Metrics & Audit Log. Combine with server.max_connections_per_ip to limit parallel guessing from one address.
Note: GSSAPI authentication requires building with the gssapi feature (e.g., cargo build --release --features gssapi or --all-features) and is supported on Unix systems.
pretty (human-readable lines) or json (one JSON object per line, for log pipelines).
The level can also be given as a filter directive (for example warn,rustsocks::server=info). The --log-level command-line option overrides logging.level. Messages written while the configuration file is being read (before logging starts) are not logged. At info, every accepted connection is logged; use warn in production if that is too verbose.
Enable the dashboard login. Without it (and without sessions.api_token) every /api/* request is rejected.
users
array
[]
Users list ([[sessions.dashboard_auth.users]], same fields as auth.users).
roles
array
[]
Role assignments ([[sessions.dashboard_auth.roles]] with username and role = viewer, operator or admin). A user without an entry is a viewer.
altcha_enabled
bool
true
Enable Altcha proof-of-work challenge.
altcha_challenge_url
string
none
External Altcha endpoint (optional).
cookie_secure
bool
true
Mark the session cookie Secure, so browsers send it only over HTTPS. Set false only when serving the dashboard over plain HTTP (for example on localhost).
Where dynamic-policy counters live: active connections, the 60-second connection rate and
daily/monthly transfer quotas used by policies. Legacy ACL rules do not
use them.
Key
Type
Default
Description
backend
string
memory
memory keeps counters in the process (quotas reset on restart, each instance enforces its own limits). redis shares them between instances; requires a build with the redis feature.
redis_url
string
none
Required for redis, e.g. redis://:${REDIS_PASSWORD}@redis:6379/0. Supports ${ENV} expansion.
key_prefix
string
rustsocks
Prefix for every Redis key, so several deployments can share one Redis. No whitespace or braces.
failure_mode
string
fail_closed
When Redis is unreachable for a policy that has limits: fail_closed denies the connection, fail_open falls back to this instance's local counters. Connections under policies without limits are always admitted.
lease_secs
integer
60
Lifetime of an active-connection lease (5-3600). A crashed instance's connections stop counting when their lease expires.
operation_timeout_ms
integer
250
Upper bound for one Redis operation on the connection path (10-10000).
memory or sqlite (uses the sessions database when available).
retention_hours
integer
24
How long to keep metrics history.
cleanup_interval_hours
integer
6
Cleanup cadence for metrics store.
collection_interval_secs
integer
5
Metrics sampling interval.
Notes:
- The /metrics endpoint is served by the stats API server, so sessions.stats_api_enabled must be true.
- When storage = "sqlite", metrics persistence requires sessions storage configured with a database URL.
The dashboard "restart" action saves the configuration and exits with code 75. Run RustSocks under a supervisor (systemd, Docker Compose, Kubernetes) configured to restart the process.