hyper-util: add Server::from_tcp
#3474
Labels
A-server
Area: server.
C-feature
Category: feature. This is adding a new feature.
E-medium
Effort: medium. Some knowledge of how hyper internal works would be useful.
K-hyper-util
Crate: hyper-util
Is your feature request related to a problem? Please describe.
Server::from_tcp
was supported before 0.1 (and exposed in Axum 0.6), but removed with the stabilization - and so, removed from Axum 0.7.This was introduced by bb4c5e2, from what I can tell.
We use it with systemd socket activation: we get the fd (or default to a Tokio TCP Listener), then start the server on this.
With axum 0.6, the following code worked:
Starting with axum 0.7, we need a lot more boilerplate (see below).
Describe the solution you'd like
Bring back
Server::from_fd
- either in hyper or hyper-util.Describe alternatives you've considered
https://github.com/tokio-rs/axum/blob/2b486ea174b263e4335490794637ea50eb04765c/examples/unix-domain-socket/src/main.rs#L55-L83
This is the current workaround - sadly it's very verbose, error prone (and hard to review when we're not tokio+axum+hyper experts).
The text was updated successfully, but these errors were encountered: