Replies: 1 comment 4 replies
-
axum uses https://crates.io/crates/tokio-tungstenite for web sockets so it would have to be supported there. Are you able to have a look at their docs? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In axum, there's this WS setting:
https://docs.rs/axum/latest/axum/extract/struct.WebSocketUpgrade.html#method.max_message_size
In our project, we'd like to limit messages clients are allowed to send over WS to something really small compared to the default - like 40 KB. At the same time, we'd like to set no limit on messages sent by the server (or set a much higher limit, like 2MB).
This is to, at least, prevent resource exhaustion / DoS attacks where server would read big messages that would consume server memory.
I understand it's not straightforward, so I'd like to hear some ideas on what to research, is it possible at all, and does it make sense.
Beta Was this translation helpful? Give feedback.
All reactions