Defaults to serve the host on 0.0.0.0 instead of localhost - #2820
Defaults to serve the host on 0.0.0.0 instead of localhost#2820lirantal wants to merge 2 commits into
Conversation
|
I do not think it should run on all interfaces by default as this might expose something you might not want to expose. I'd say leave it as and use --host 0.0.0.0 whenever you need. |
|
I understand that this might raise some eyebrows, but my own opinion is that you won't be using the angular-cli on anything production system, hence I don't see any issues with listening on all interfaces. Leaving it up to the maintainers to figure out if they're interested in this or not. |
|
You said it yourself. This is not production and thus should not be open to the public. Just create add a script called start or something in your package.json that does "ng serve --host 0.0.0.0". |
In my opinion this is not a very a good thing to do. I think a lot of people would consider that a very wrong, very unexpected, and perhaps dangerous default. If you want to be binding to some other address without having to type it each time, you can either create a script as the other comments suggest or even use |
|
This was already discussed at length in a previous PR (which was closed): #1475. |
|
What @clydin said 💃 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Problem
On cloud9 (c9.io), the online IDE, if you run
ng serveit will bind to the localhost/127.0.0.1 by default and the browser can't view the page because it has to bind to an actual public IP to access it (as this is an IDE over the web).The default doesn't consider the
$IPenvironment variable.Solution
Defaults to bind on 0.0.0.0 for all available interfaces.
Since the CLI tool is used to serve as a developer productivity tool this shouldn't bring up security concerns.