1

I'm trying to externally access my local node.js development server that's created using the grunt-contrib-connect plugin. The server works (locally) when I use localhost or 127.0.0.1 as the hostname parameter. However, when I change the parameter to * or 0.0.0.0 in order to allow external access (as specified in the documentation), I cannot access the server either locally or externally; this is the error I get in Chrome:

The error message in Chrome

I've tried disabling my firewall and I can see packets coming in from my phone on the correct port (which I'm using to attempt to access my local server externally).

Any ideas why it doesn't work to use * or 0.0.0.0 as the hostname?

Nathan Friend
  • 12,155
  • 10
  • 75
  • 125

2 Answers2

3

Figured it out - when I specified * or 0.0.0.0 as the hostname parameter, I was able to connect externally - I just hadn't tried since I wasn't able to access it locally and assumed it wasn't working at all. Changing the address in the browser to localhost:9000 (instead of 0.0.0.0:9000, which it defaults to) when Grunt first opens the page allowed me to access my server locally.

Nathan Friend
  • 12,155
  • 10
  • 75
  • 125
2

You can set your own ip address instead of the 0.0.0.0. With this grunt launch the server on your ip. You can use your mobile to. The livereload will work on your desktop and on your mobile.

It's not the best way if your work by team because each one have his ip address but it's good enough if you work alone.

GBMan
  • 475
  • 2
  • 4
  • 16