Skip to content

Commit

Permalink
Add ability to set read_buffer_size for websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarathustra2 committed Jan 10, 2025
1 parent d07d129 commit 22fa1fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions axum/src/extract/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ impl<F> std::fmt::Debug for WebSocketUpgrade<F> {
}

impl<F> WebSocketUpgrade<F> {
/// Read buffer capacity. The default value is 128 KiB.
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.
///
Expand Down

0 comments on commit 22fa1fb

Please sign in to comment.