Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Doing some node development on windows. Node programs like to kick out URLs that look like In Linux (iirc) pasting that url into the browser will be successful. But in Windows, it's a 404. I thought I'd just be able to add: localhost

to my hosts file but that doesn't seem to work. For instance, I have a debugger running on http://localhost:8080/debug?port=5858. Works fine. But when I add the above line to my hosts file and try to access I get:

Error 108 (net::ERR_ADDRESS_INVALID): Unknown error.

Node-inspector is a good example:

$ node-inspector                                                      
   info  - started                                          
visit to start debugging  

Do I just need to manually edit that IP to be equal to localhost when copy/pasting? Or is this a weird difference between Linux and Windows?

How do I get to be equivalent to localhost when browsing urls in Windows 7? Chrome is my 'default' browser.

share|improve this question
refer to rfc1122 for details on your question: – Lorenzo Von Matterhorn Jan 14 '13 at 18:55
"many node programs expect to be equal to" ... What? This... I have no words. – Ignacio Vazquez-Abrams Jan 14 '13 at 18:58
also this: – Lorenzo Von Matterhorn Jan 14 '13 at 18:58
Binding to allows incoming connections from any interface; making it localhost only will break so very much. – Ignacio Vazquez-Abrams Jan 14 '13 at 19:00
Why not tell node-inspector et alia to bind to instead? – Ignacio Vazquez-Abrams Jan 14 '13 at 19:03
up vote 3 down vote accepted

So, what's happening here is that node is binding to - netspeak for "All interfaces". This includes localhost, any real interfaces you have, and any virtual interfaces you have. It in and of itself generally does not point to an individual interface. (Technically, it points to "This host on this network", but that's ambiguous at best because "this network" is not defined. So is usually understood to point represent the local computer's IP on every network)

Do you need to manually edit that IP when copy/pasting? Yes. If Linux or a specific browser on linux happens to silently correct it to awesome. But as you've found out, that's not a universal thing.

share|improve this answer
Blech, I figured the answer was "that's just windows" but was hoping for better. – jcollum Jan 14 '13 at 20:08 converted to http://localhost:8080/debug?port=5858 will work then... – Fiasco Labs Jan 14 '13 at 20:08
It will, but it's a pain to do it everywhere everytime. – Rob Jan 14 '13 at 20:12
FiascoLabs If you read the original question, it does. @jcollum I would actually use that same sentiment towards linux here - It's supporting obscure, ambiguous usecases which only serve to limit interoperability, and I would further blame node.js for not properly cleaning up the URL before printing it out. – Darth Android Jan 14 '13 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .