Skip to content
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

Add serve_uds to axum-extra #2474

Open
davidpdrsn opened this issue Dec 30, 2023 · 6 comments
Open

Add serve_uds to axum-extra #2474

davidpdrsn opened this issue Dec 30, 2023 · 6 comments
Labels
A-axum-extra C-feature-request Category: A feature request, i.e: not implemented / a PR.

Comments

@davidpdrsn
Copy link
Member

axum::serve intentionally only supports TcpListener because it greatly simplifies the API. However that means serving over a unix domain socket requires a lot of boilerplate.

We should add a dedicated serve_uds function to axum-extra that makes that easier. I should be possible to more or less copy axum::serve and use Tokio's UnixListener instead.

@davidpdrsn davidpdrsn added C-feature-request Category: A feature request, i.e: not implemented / a PR. A-axum-extra labels Dec 30, 2023
@davidpdrsn davidpdrsn changed the title Add serve_uds Add serve_uds to axum-extra Dec 30, 2023
@vi
Copy link
Contributor

vi commented Dec 30, 2023

Will it also make serving connections over arbitrary AsyncRead+AsyncWrite pairs easier?

@davidpdrsn
Copy link
Member Author

davidpdrsn commented Dec 30, 2023

No. hyper 0.14's server used to allow that but it leads to nasty trait bounds which I really want to avoid.

@fundon
Copy link

fundon commented Jan 1, 2024

A trait for a listener already exists: Listener

@davidpdrsn
Copy link
Member Author

Oh neat! That might be worth trying to use.

@jplatte
Copy link
Member

jplatte commented Jan 13, 2024

So I guess #2479 will work for UDS and we don't actually want to add a separate serve_uds?

@davidpdrsn
Copy link
Member Author

davidpdrsn commented Jan 13, 2024

Yes exactly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum-extra C-feature-request Category: A feature request, i.e: not implemented / a PR.
Projects
None yet
Development

No branches or pull requests

4 participants