-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
IPV6 error with percent devicename (for link-local ranges / zone id) #12410
Comments
WHATWG URL intentionally omits support for link-local addresses (ref). I don't know if we have decided to freeze On the other hand, we do accept link-local addresses in e.g. |
Ya with the turtle tool I made this PR to patch it for now so I got that working. Proving it was the case We discuss what you already know about link-local. The need is apparently real, there was no easier route to create the server. listen barfed EINVAL without the %Zone ID etc. The use case is server to server with secondary IPs on same multi CPU machines as well as same zone, with ipv6 that could intelligently route (least route etc.) globally across zones I suppose. |
Maybe I'm missing something about how to connect server to server but with the tool I mentioned, which is pretty streamline, I would get errors without the devName in the ipv6 address when calling listen (see links). Then only after hacking a temporary patch did it connect fine, works perfectly (and no other way seemed to work). I think the local block is the correct ipv6 range where it should work, as it's the default for the primary ipv6 address. |
@MasterJames maybe you can describe you use-case in more detail, network setup, device names, how you were using URL, and what didn't work? This may be a mismatch between what webbrowsers want from a URL library, and what Node users want, but you'll have to layout your argument in a much more detailed way to convince the WhatWG. |
It was documented through the previous referenced article that was mentioned above. If anyone has any other ideas, how to go about doing it differently, I do appreciate and welcome it. Possibilities I've considered, the problem will go away/change in Data Centre on AWS because of how Secondary IPs are handled, etc. and so? taking an externally bounced IP makes more sense? No I come back to this being an oversight in the specs somewhere and should be clarified between associations, and may be a big issue. I think it's pretty important but I personally have a simple work around (shown in links package relevant) or two so I'm not that concerned. |
I wouldn't get your hopes up. As mentioned, the WHATWG URL specification explicitly prohibits link-local addresses for security reasons. That means we can't add it to The security argument also applies to node's own You are welcome to try your hand at a pull request but you should be prepared for rejection. If all else fails, you can simply copy out node's lib/url.js and publish it with your changes as an npm module. |
I've just read the article you referenced. It seems it's fully recognized as important, but later considered not typical enough for the complications it causes? In light of it being "difficult" and "challenging", in the end he says there's some concern over how other browsers might handle them differently. Sounds strange to me. Also I was concerned it makes for bad gateway bouncing traffic maybe, if your using a public IPV6 address instead of local FE80 range, to talk server to server inside the data centre? So personally I wasn't that impressed with the arguments, but understand them. My patch has worked fine, is super simple could be better, it's not a devastating issue. I also think the introductory package I'm working with (links above) may blur the lines server side which is using a client connect to access local addresses, maybe it's more browser side code tangled in and I don't see that from the package/wrapper level. Anyway again still seems important to me. Sometimes the code wants to evolve the spec, we should let it. -MJ |
@nodejs/url Should this remain open? |
I'll close it out. PR welcome but no guarantee it will be accepted. |
There is a simple work around as far as I'm concerned. Just took the time to assess what gives. Seemed like a simple to fix no Brainer to me at the time. Kinda still does. Thanks for listening sorry to bother. |
My workaround after long hours of trying this approach:
And to use it in a WebSocket (which only accepts a url of type URL):
Hacky, but, IT WORKS. |
@Bartel-C8 Be careful. Please do not depend on symbol properties on URL objects. They are intentionally hidden for a reason, and your subclass can break any time. Node.js may very well start using private properties soon, which cannot be overridden this way. |
The url parse function does not function properly when a percent sign (%) deviceName is included in the square brackets of an ipv6 address.
The example you will find here... [fe80::a00:234f:fe1e:29af%enp0s3]
theturtle32/WebSocket-Node#278
On an Ubuntu Server VM with nodejs you see hostname empty after parse thinks the percent means path not host.
extra root path marker extra.
Also Note: that I could not get chrome debugging working on 7.8.0 so I reverted.
The text was updated successfully, but these errors were encountered: