Skip to content
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

Change default IP from "localhost" to "0.0.0.0" #60

Closed
cowboy opened this issue Nov 20, 2013 · 12 comments
Closed

Change default IP from "localhost" to "0.0.0.0" #60

cowboy opened this issue Nov 20, 2013 · 12 comments
Milestone

Comments

@cowboy
Copy link
Member

cowboy commented Nov 20, 2013

By specifying 0.0.0.0, the server will bind to all IPs, allowing both "localhost" to continue to work (locally) as well as allowing the server to be accessed from external devices via the machine's IP or hostname.

Will this cause any problems? We would have to bump the minor version, but this change is awesome in my testing, here.

Any downsides?

@cowboy
Copy link
Member Author

cowboy commented Nov 20, 2013

If people were concerned about outside access, they could just use their OS firewall to block that... but I'm finding the benefit of just being able to connect to a dev server from another machine to be incredibly useful.

@eddiemonge
Copy link
Contributor

Per the docs, if the desire is to allow all ips to work, then it should be changed to hostname: '*' https://github.com/gruntjs/grunt-contrib-connect#hostname

@eddiemonge
Copy link
Contributor

I think it should stay localhost and those that know what they are doing and want to allow others to connect can change their ip to *. Keep the security for the newer people are people who arent aware and let the more advanced people change it.

@cowboy
Copy link
Member Author

cowboy commented Jan 15, 2014

Think about it this way:

Default to localhost, Gruntfile uses defaults

  • Someone who doesn't want or care about outside access doesn't need to do anything.
  • Someone who wants outside access has to modify their Gruntfile to change this option, which is an inconveince and risks accidentally committing this change to the project.

Default to 0.0.0.0, Gruntfile uses defaults

  • Someone who wants outside access doesn't need to do anything.
  • Someone who doesn't want or care about outside access doesn't have to touch the Gruntfile or modify the project in any way, it just works. They can enable their OS firewall if they're concerned, however, which they've probably already done if they're aware of issues like this.

I think it's more helpful to not have to modify project files unnecessarily than to worry about whether the developer in question knows what a firewall is. Besides, how often is outside access a problem? I've never joined a public wifi without first enabling my OS firewall, so I've don't really see this as an issue.

I think the benefits of defaulting to 0.0.0.0 far outweigh the drawbacks.

@cowboy
Copy link
Member Author

cowboy commented Jan 15, 2014

@tkellen
Copy link
Member

tkellen commented Jan 15, 2014

Agreed. Do it!

@cowboy
Copy link
Member Author

cowboy commented Jan 15, 2014

FWIW, when I created this task, I misunderstood how binding to localhost worked. Had I known what I know now, I would have definitely used 0.0.0.0 instead.

@vladikoff
Copy link
Member

Sure! Bump to 0.7.0

@cowboy
Copy link
Member Author

cowboy commented Jan 15, 2014

I'm going to see if there are any other changes first before releasing a new version.

RichVisual referenced this issue in RichVisual/angular-strap Apr 27, 2014
It's already '0.0.0.0', doesn't need to be changed to that.  Added link for further explanation on that topic, and why demands for network access to the server (outside localhost) lead to using '0.0.0.0'
@rienheuver
Copy link

On my windows 8.1 machine, this actually breaks something for me. 0.0.0.0:35729 will not access the livereload-server. Somehow 0.0.0.0 doesn't look at my machine at all (0.0.0.0:8000 gives an address invalid too).

@vatsalpande
Copy link

I am running windows 8 and if I change it to 0.0.0.0 it starts to look for ip address 0.0.0.0 and hence starts giving error

@piotr-dobrogost
Copy link

You can't connect with address 0.0.0.0 on Windows – http://stackoverflow.com/a/28230165/95735 Use localhost or address 127.0.0.1 instead when connecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants