-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(ext/http): add support for unix domain sockets #13628
Conversation
Thanks, this looks quite good, but we definitely need some tests to be able to land it. |
@bartlomieju Hi, I'm willing to add some tests, but I don't know where to put them. I didn't find existing tests for the ext/http crate. Should I create a tests folder for the ext/http crate and test in Rust, or somehow test it in Typescript? |
Sorry I forgot to mention. Tests should be added to |
@bartlomieju Thanks. I have added a test for it. However I'm not very sure what the url should look like. I have chosen |
340c55e
to
8c33717
Compare
I'm not sure I understand. Where is this URL being used? |
The URL is used to construct the Request object which finally expose to the user. Example:
Currently it is constructed using the |
@lucacasonato what do you think about the URL? |
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 URL pattern seems fine. By extension of Deno.listen(transport: unix)
being unstable, this would be unstable too. As such I think we can merge it for 1.19.
Just have a minor comment on the test.
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.
Declaration files should be updated for Deno.serveHttp
to hint that unix sockets can be used, and as Luca pointed out it should be marked as unstable
Hi @bartlomieju , I have added the unstable check. About the declaration, |
Hi, any idea about the CI failling? It passes locally and the last edit is only adding the unstable check. I can't interpret the CI output. |
I landed a PR that broke |
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.
LGTM. Great job @ylxdzsw! 🎉
This adds support for unix domain sockets in ext/http (#13626). The primary change is replace
std::net::SocketAddr
with a custom enum so we can store the address of a unix domain socket. I have to make this typepub
in order to refer to it in runtime/ops/http.rs .