#[non_exhaustive]pub struct Config {Show 18 fields
pub max_connections: usize,
pub allowed_origins: Option<Vec<String>>,
pub client_subscriptions: bool,
pub e2e_identity_key: Option<Vec<u8>>,
pub e2e_legacy: bool,
pub signing_key: Option<Vec<u8>>,
pub signature_window: u64,
pub bind_sessions: bool,
pub max_message_size: usize,
pub ping_interval: u64,
pub idle_timeout: u64,
pub max_outbound_queue_bytes: usize,
pub max_subscriptions_per_connection: usize,
pub rate_limit_capacity: f64,
pub rate_limit_refill: f64,
pub jwt: Option<JwtSettings>,
pub recovery: Option<RecoverySettings>,
pub presence: Option<PresenceSettings>,
/* private fields */
}Expand description
What a server is configured with. Start from Config::default() and set
the fields that differ: the defaults are those of the Python server. Its
Debug print shows whether a key is set, never the key.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_connections: usizeRegistered connections at most; more are refused (1013).
allowed_origins: Option<Vec<String>>Origins a browser may connect from; None: any.
client_subscriptions: boolWhether the server answers the clients’ own subscribe and unsubscribe requests.
e2e_identity_key: Option<Vec<u8>>The identity key that signs each E2E session handshake: an ECDSA P-256 private key in PKCS#8 (PEM or DER). None: no E2E sessions.
e2e_legacy: boolWhether clients may still use the first E2E design.
signing_key: Option<Vec<u8>>The server’s key for signed messages: an ECDSA P-256 private key in PKCS#8 (PEM or DER).
signature_window: u64How far, in seconds, a signed message’s time may be from the server’s.
bind_sessions: boolA token that names the client’s key (cnf) binds the connection to
it (true, the default): the client must open an end-to-end session
and prove the key inside it before it is admitted, so a token copied
on the way opens nothing. False: the key only checks the client’s
signed messages, and the token is a bearer token like any other.
max_message_size: usizeA client’s message is at most this many bytes.
ping_interval: u64Seconds between the server’s pings: at least 1, below idle_timeout.
idle_timeout: u64A connection silent for this many seconds is closed: at most a week.
max_outbound_queue_bytes: usizeBytes waiting to be written to one connection at most; past them it misses messages, and a connection over them for two pings is closed (1013). 0: no limit.
max_subscriptions_per_connection: usizeTopics one connection may subscribe to at most; 0: no limit.
rate_limit_capacity: f64A connection’s messages: a token bucket of this many.
rate_limit_refill: f64… refilled at this many per second.
jwt: Option<JwtSettings>Tokens the server validates itself; None: the application accepts
each connection (Publisher::accept).
recovery: Option<RecoverySettings>Message history for clients that come back; None: no recovery.
presence: Option<PresenceSettings>Who is on a topic; None: no presence.