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: 2 comments 4 replies
-
|
There is no way with |
Beta Was this translation helpful? Give feedback.
There is no way with
axum::serveright now (feel free to open a feature request), but if you follow theserve-with-hyperexample, you can move theserver::conn::auto::Builderto a new binding, and call.http1().keep_alive()on it beforeserve_connection_with_upgrades.