-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[breaking change] Implement HTTP/1/2-only support #130
base: master
Are you sure you want to change the base?
Conversation
Me either. |
/// Returns a mutable reference to the Http builder. | ||
pub fn http_builder(&mut self) -> &mut Builder<TokioExecutor> { | ||
&mut self.builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see this API remain available, as I use it to configure many settings for both HTTP/1 and HTTP/2 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to expose anything Builder
exposes through axum-server
s interface.
What method exactly are you unable to access with the new API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't see how I would access these:
serve
.http_builder()
.http1()
.timer(hyper_util::rt::TokioTimer::new())
.keep_alive(true)
.header_read_timeout(Duration::from_secs(5))
.max_buf_size(32768)
.http2()
.timer(hyper_util::rt::TokioTimer::new())
.keep_alive_interval(Duration::from_secs(16))
.keep_alive_timeout(Duration::from_secs(5))
.max_header_list_size(512 * 1024)
.max_send_buf_size(64 * 1024)
.max_concurrent_streams(16);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I assume if we expose Builder::http1()
and Builder::http2()
this would cover all the methods you have listed?
The PR should probably be in draft mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an intermediate solution that does not breaks compatibility that can be used, see #156. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad it doesn't break compatibility. Still don't personally understand the API or the use-case but you have to convince the maintainer, not me ;)
This PR changes dependencies to be more careful about the default features enabled.
Now HTTP/1 and HTTP/2 are enabled by default but can be disabled if so desired.
There is also now a way to set the server to only enable one of the two protocols.
This would re-open #80 and I have no clue how to solve that without a major redesign of the public API.
The only easier way that comes to mind is cloning the
ServerConfig
and then modifying the ALPN if it doesn't match while handling theAcceptor
.I will leave this open until the next version upgrade.