pub struct ListenerConfig {
pub addr: SocketAddr,
pub idle_timeout: Duration,
pub slow_threshold: Duration,
pub auth_required: bool,
pub tls: Option<ServerTls>,
}Expand description
Listener configuration. Family posture keeps binds loopback/private by default (SRV-040 guidance).
Fields§
§addr: SocketAddrAddress to bind. Port 0 picks an ephemeral port — read it back
via ListenerHandle::local_addr.
idle_timeout: DurationPer-read idle timeout (slow-loris resistance, SRV-009). Zero disables, matching each product’s current posture.
slow_threshold: DurationCommands slower than this bump slow_commands_total (SRV-030).
Zero disables the counter.
auth_required: boolWhether this deployment enforces credentials (SRV-011).
This is policy, not protocol: the profile fixes the handshake
shape (does the client lead with HELLO? does it authenticate via
AUTH?), while this flag decides whether the server actually refuses
un-credentialed sessions. Both family products that authenticate on
the RPC path expose exactly this toggle — Nexus’s auth_required and
Synap’s require_auth — and an open Synap deployment is the reason
it must live here rather than in the profile.
Ignored under Handshake::None, which has no gate at all. Defaults
to true: a deployment opens up only by saying so.
tls: Option<ServerTls>Optional TLS (SRV-040 / SPEC-008 CAN-020). Some turns TLS on for this
deployment; None (the default) keeps it plaintext. Requires the crate’s
tls feature — a listener configured with TLS but built without it fails
to start rather than silently serving plaintext.
Implementations§
Source§impl ListenerConfig
impl ListenerConfig
Sourcepub fn new(addr: SocketAddr) -> Self
pub fn new(addr: SocketAddr) -> Self
Config for addr with the defaults: no idle timeout, 1000 ms slow
threshold, credentials enforced, plaintext.
Trait Implementations§
Source§impl Clone for ListenerConfig
impl Clone for ListenerConfig
Source§fn clone(&self) -> ListenerConfig
fn clone(&self) -> ListenerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more