-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: add unixSocket
option and +unix
suffix support to protocol
#1874
Conversation
I finally managed to look a bit at url parsing... I think it is broken in nodejs: nodejs/node-v0.x-archive@a94ffda#diff-3755baff71802c66753e9be67b9b7c0e219dd0b61fda072a0009f807a3 It hallucinates (trendy word now) a path part of URL for ipv6 addresses.
So I agree that stripping But I would still be very cautious about what is sent to Therefore I would move choice between port/host vs path closer to where |
@ytimenkov Thanks for your research, I think so that the only reliable way to fix this is add a boolean option like |
Not sure how boolean option will help. Curl's option is a string, because you have 2 paths: the first one is address (goes into I wonder if curl sets This placeholder reminds me about another project Ansible - I think it also recognizes "localhost" and executes tasks in place rather than going via ssh. This is if you want to provide complete feature-parity between inet(6) and local address for all protocols (kid of hook into the name resolver). A smaller change would be sacrificing functionality (ws over unix sockt) and use something like "mqtt+unix". This is close to a boolean option you suggested and what is already implemented - for !ws, check if protocol ends with "+unix" and then take either path part or port-host. With or without that url parsing inconsistency in nodejs, mqtt protocol doesn't care about path, does it? So I think it's good to be a bit more explicit and have clear distinction between these 2 paths, rather than "pass-through everything and hope it works somehow". How did you see the boolean option? |
I don't like it as I would prefer not adding other options but let's think about the possible cases:
I think that those cases should cover all the possible conflicts while parsing the url.
About this, this is only valid when calling the create connection with two args, in our case the first argument is an object with all the options set (both for tcp and tls) The only thing that makes me prefer the |
unixSocket
option and +unix
suffix support to protocol
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
Fixes #1873