diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index 96bea47130..70b132cfcd 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -152,6 +152,12 @@ impl std::fmt::Debug for WebSocketUpgrade { } impl WebSocketUpgrade { + /// Read buffer capacity. The default value is 128KiB + pub fn read_buffer_size(mut self, size: usize) -> Self { + self.config.read_buffer_size = size; + self + } + /// The target minimum size of the write buffer to reach before writing the data /// to the underlying stream. ///