Can I customize keep-alive settings? #2939
-
SummaryHello! I assume the axum(hyper) uses the following things: Are there any elegant ways to control the option keep_alive(enable/disable) setting globally when the app starts? Can I pass config for Hyper when use axum::serve(listener, app) ? Are there any ways to control the option keep_alive setting in middleware only for some connections? For example, actix: https://actix.rs/docs/server/#keep-alive
Thanks! axum version0.7.6 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is no way with |
Beta Was this translation helpful? Give feedback.
There is no way with
axum::serve
right now (feel free to open a feature request), but if you follow theserve-with-hyper
example, you can move theserver::conn::auto::Builder
to a new binding, and call.http1()
.keep_alive()
on it beforeserve_connection_with_upgrades
.