pub struct ServerConfig {
pub bind: SocketAddr,
pub data_dir: PathBuf,
pub authorized_keys_path: PathBuf,
pub mode: Mode,
pub issue_admin_token: bool,
pub admin_bind: Option<SocketAddr>,
pub admin_session_ttl: Duration,
pub peer_list_path: PathBuf,
pub tcp_fallback_bind: Option<SocketAddr>,
pub bw_partitions: usize,
pub resume_grace: Option<Duration>,
}Expand description
Everything the server needs at startup.
Fields§
§bind: SocketAddrUDP address to bind the QUIC endpoint on.
data_dir: PathBufDirectory used for persistent state (identity cert, admin_token hash).
Path to the authorized_keys file.
mode: ModeDeployment mode.
issue_admin_token: boolIf true, always print a fresh admin token at startup.
admin_bind: Option<SocketAddr>§16.4: TCP bind for the structured admin API. None disables
the endpoint. Default is loopback-only (127.0.0.1:9700);
operators exposing it publicly are expected to front it with a
TLS reverse-proxy.
admin_session_ttl: Duration§16.4: TTL of admin API session tokens minted from the
enrollment admin_token.
peer_list_path: PathBuf§16.3.2: on-disk static peer list. Missing file = empty list (no federated peers). Hot-reloaded on file change.
tcp_fallback_bind: Option<SocketAddr>§16.1.4: optional TCP+TLS bind for the krot-tcp/1 fallback
transport. None disables the fallback listener; clients
with UDP blocked will simply not be able to connect. Default
is None — operators opt in.
bw_partitions: usize§9.2 per-core rate-limit partitions. Should match the actual
worker count (1 for Server::run, cores for
Server::run_multicore). Each identity’s bw= cap is
divided evenly across this many buckets so cores don’t
contend on a single governor bucket. Default 1.
resume_grace: Option<Duration>§7.3 session-resume grace period. When a client disconnects
abruptly (no ServerBye), its tunnels stay in Dangling state
for this long so a reconnecting client can pick up the same
public URLs. None = protocol default (30s). Local dev may
want a shorter value so Ctrl+C → immediate re-run works.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn local_in(data_dir: PathBuf) -> Self
pub fn local_in(data_dir: PathBuf) -> Self
A local IpMode config with fresh state in data_dir. Useful for tests.