pub struct WebsocketServerConfig { /* private fields */ }Expand description
A set of configuration options for the websocket server.
Implementations§
Source§impl WebsocketServerConfig
impl WebsocketServerConfig
Sourcepub fn new(address: SocketAddr) -> Self
pub fn new(address: SocketAddr) -> Self
Constructs a new WebsocketServerConfig with the given address to listen on.
Sourcepub const fn handshake_timeout(self, timeout: Duration) -> Self
pub const fn handshake_timeout(self, timeout: Duration) -> Self
Sets the timeout for websocket handshakes.
When tls is enabled, this time includes the tls handshake as well.
Sourcepub const fn max_message_size(self, size: Option<usize>) -> Self
pub const fn max_message_size(self, size: Option<usize>) -> Self
Sets the maximum size of an incoming message. None means no size limit. The default value is 64 MiB
which should be reasonably big for all normal use-cases but small enough to prevent
memory eating by a malicious user.
Sourcepub const fn max_frame_size(self, size: Option<usize>) -> Self
pub const fn max_frame_size(self, size: Option<usize>) -> Self
Sets the maximum size of a single incoming message frame. None means no size limit. The limit is for
frame payload NOT including the frame header. The default value is 16 MiB which should
be reasonably big for all normal use-cases but small enough to prevent memory eating
by a malicious user.
Trait Implementations§
Source§impl Clone for WebsocketServerConfig
impl Clone for WebsocketServerConfig
Source§fn clone(&self) -> WebsocketServerConfig
fn clone(&self) -> WebsocketServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more