pub struct ServerConfig {
pub control_port: u16,
pub proxy_port: u16,
pub proxy_url: String,
pub include_paths: Vec<String>,
pub exclude_paths: Vec<String>,
pub enable_websocket: bool,
pub forward_get_only: bool,
pub control_auth: Option<String>,
pub cache_404_capacity: usize,
pub use_404_meta: bool,
}Fields§
§control_port: u16§proxy_port: u16§proxy_url: StringThe URL of the backend to proxy to
include_paths: Vec<String>Paths to include in caching (empty means include all) Supports wildcards: [“/api/”, “//users”]
exclude_paths: Vec<String>Paths to exclude from caching (empty means exclude none) Supports wildcards: [“/admin/”, “//private”] Exclude overrides include
enable_websocket: boolEnable WebSocket and protocol upgrade support (default: true) When enabled, requests with Connection: Upgrade headers will bypass the cache and establish a direct bidirectional TCP tunnel
forward_get_only: boolOnly allow GET requests, reject all others (default: false) When true, only GET requests are processed; POST, PUT, DELETE, etc. return 405 Method Not Allowed Useful for static site prerendering where mutations shouldn’t be allowed
control_auth: Option<String>§cache_404_capacity: usizeCapacity for the 404 cache (default: 100) Limits the number of different 404 responses cached to prevent memory abuse
use_404_meta: boolDetect 404 pages via meta tag in HTML body in addition to HTTP status This lowers performance and should be enabled only when needed.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more