-
Notifications
You must be signed in to change notification settings - Fork 7.3k
net.connect fails looking up localhost when offline #25489
Comments
This seems to be a Windows specific issue. I haven't been able to reproduce it on Linux. I haven't tested it on OSX or on SmartOS. The documentation for
This is has been fixed in other open source software projects by not using the So I would suggest not using /cc @joyent/node-tsc Thoughts? |
I'm actually not sure that this is the best option. I should have investigated the impact of such a change more thoroughly before making such a suggestion, but that's one option. |
Reproduced on Windows 8 with node v0.12.4 |
If the issue is still relevant - please join the discussion here. |
Is there any example that on Windows using getaddrinfo function without AI_ADDRCONFIG flag is impossible or inconvenient or slow??? When AI_ADDRCONFIG flag could be extremely important??? |
Would like to confirm the issue is still relevant (see Karma issue above). |
@RobertDiebels can re-open a new issue on nodejs/node if this is still relevant. Its unrelated to the issue you thought it was related to (nodejs/node#8436) |
Just want to chip in that @RobertDiebels is still relevant. Feels really stupid bode doesnt resolve localhost when the network is missing.. |
Could you provide some more info:
Is it just node having trouble, or is this just how domain resolution works? |
System tools can resolve 'localhost' when the network is offline:
node.js cannot resolve 'localhost' when the network is offline:
node version:
|
@gtirloni See nodejs/node#11320 for more discussion. I'll close out this one. |
Socket.prototype.connect
does not properly handle localhost or the ENOENT error thrown when performingdns.lookup
.This is reproducible with v0.12.2 x64 on Windows 7 when offline:
ENOENT is the expected behaviour per the docs (via joyent/25338:
I'd propose switching from
localhost
to127.0.0.1
or::1
as required, but it wouldn't be a a complete solution sincelocalhost
is name resolved per system in the host file. Refer to:The text was updated successfully, but these errors were encountered: