tokio-rs / axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
19.21k stars 1.06k forks source link

Can `axum::serve` handle both http 1 and 2? #1953

Closed davidpdrsn closed 1 year ago

davidpdrsn commented 1 year ago

axum::Server was a re-export of hyper::Server which is going away for hyper 1.0. Therefore axum is getting axum::serve(tcp_listener, service) in 0.7 for simple use cases.

It currently only supports http 1. We should investigate if we can also support http 2. Might require https://github.com/hyperium/hyper-util/pull/11

programatik29 commented 1 year ago

It should be possible when the PR is merged.

rakshith-ravi commented 1 year ago

Looks like that got merged. Is this something we can do now? Can I help in any way?

davidpdrsn commented 1 year ago

Great! I'm curious if we can just replace the implementation of axum::serve to instead be a small wrapper around something in hyper-util. That was always the intention. Would be much appreciated if you'd give that a shot!

rakshith-ravi commented 1 year ago

@rustbot claim

rakshith-ravi commented 1 year ago

No rustbot? Lol okay. Force of habit I guess