diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index 62ecbf2..8b3de04 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -108,6 +108,11 @@ impl WebSocket { pub fn get_mut(&mut self) -> &mut Stream { self.socket.get_mut() } + + /// Change the configuration. + pub fn set_config(&mut self, set_func: impl FnOnce(&mut WebSocketConfig)) { + set_func(&mut self.config) + } } impl WebSocket {