pub struct ServerConfig {Show 16 fields
pub name: String,
pub version: String,
pub description: Option<String>,
pub icons: Vec<Icon>,
pub website_url: Option<String>,
pub host: String,
pub port: u16,
pub transport_mode: String,
pub enable_sse: bool,
pub enable_oauth: bool,
pub max_connections: usize,
pub request_timeout_secs: u64,
pub response_timeout_secs: u64,
pub allowed_hosts: Vec<String>,
pub allowed_origins: Vec<String>,
pub dns_rebinding_protection: bool,
}Expand description
Server configuration
§Hot Reload Support
⚠️ Does not support hot reload - Server configuration changes require server restart to take effect.
Reason: These configurations involve server listening socket, transport layer initialization and other core parameters, runtime changes may cause connection interruption or state inconsistency.
Fields§
§name: StringServer name
version: StringServer version
description: Option<String>Server description
icons: Vec<Icon>Server icons
website_url: Option<String>Website URL
host: StringHost address
port: u16Port
transport_mode: StringTransport mode
enable_sse: boolEnable SSE support
enable_oauth: boolEnable OAuth authentication
max_connections: usizeMaximum concurrent connections
request_timeout_secs: u64Request timeout (seconds)
response_timeout_secs: u64Response timeout (seconds)
allowed_hosts: Vec<String>Allowed Host header values for DNS-rebinding protection.
Only enforced when dns_rebinding_protection is true. Matching is
exact and case-insensitive (no wildcards); entries must include the
port clients connect to, e.g. ["127.0.0.1:8080", "localhost:8080"].
Has no effect while dns_rebinding_protection is false.
allowed_origins: Vec<String>Allowed Origin header values for DNS-rebinding protection.
Only enforced when dns_rebinding_protection is true. Matching is
exact and case-insensitive (no wildcards); list full origins including
scheme and port, e.g. ["http://localhost:8080"]. The * wildcard is
NOT supported. Has no effect while dns_rebinding_protection is
false.
dns_rebinding_protection: boolEnable DNS rebinding protection for HTTP/SSE transports.
When true, the server validates the Host and Origin request
headers against allowed_hosts / allowed_origins and rejects
mismatches with HTTP 403. Defaults to false for backwards
compatibility (matching the underlying SDK).
Note: matching is exact and case-insensitive (no wildcards). When
enabling this, allowed_hosts must contain the exact host:port
values clients send (e.g. "127.0.0.1:8080"), and allowed_origins
must list exact origins (e.g. "http://localhost:8080"); the example
defaults with a * wildcard will not match.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more