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

Server example doesn't use hyperlocal? #70

Open
stevenengler opened this issue Apr 26, 2024 · 2 comments
Open

Server example doesn't use hyperlocal? #70

stevenengler opened this issue Apr 26, 2024 · 2 comments

Comments

@stevenengler
Copy link

stevenengler commented Apr 26, 2024

This may just be a misunderstanding on my part, but hyperlocal advertises itself using (emphasis added):

Hyper is a rock solid Rust HTTP client and server toolkit. [...] hyperlocal builds on and complements Hyper's interfaces for building Unix domain socket HTTP clients and servers.

Later in the README it gives a server example at examples/server.rs, but this example doesn't even seem to use hyperlocal. So I don't understand why hyperlocal advertises itself as being a server toolkit, while the server example doesn't use hyperlocal. This leaves me (as someone seeing the library for the first time) confused about what this project actually is or what it does.

@girlbossceo
Copy link

I agree, I'm not sure if this library is needed now with hyper v1. My Rust project used hyperlocal before hyper v1 and we found that to be necessary for listening on UDS. However hyper v1 now seems to support binding to a UDS perfectly fine, it's just not documented (attempts at getting it documented were rejected here and here). The original server example pre-hyper v1 used itself, but now after the hyper v1 update to hyperlocal, all mentions of hyperlocal were removed in the server example.

@stevenengler
Copy link
Author

The original server example pre-hyper v1 used itself, but now after the hyper v1 update to hyperlocal, all mentions of hyperlocal were removed in the server example.

Ah okay, that makes sense. I guess this issue can be about updating the documentation to explain the current status, as it's not very clear without knowing the historical background.

However hyper v1 now seems to support binding to a UDS perfectly fine, it's just not documented (attempts at getting it documented were rejected here and here).

As an aside, one thing that the approaches in the examples above don't support is setting file permissions on the unix socket before binding, which is useful for security. Maybe this library could provide a convenience method for that, which is a bit of a pain to do manually (create non-blocking unix socket, fchmod, bind, listen, and an extra chmod) as the process can be platform-dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants