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

ng serve - doesn't listen on all interfaces by default #2275

Closed
yuri1969 opened this issue Sep 21, 2016 · 6 comments
Closed

ng serve - doesn't listen on all interfaces by default #2275

yuri1969 opened this issue Sep 21, 2016 · 6 comments

Comments

@yuri1969
Copy link

yuri1969 commented Sep 21, 2016

ng help lists Listens on all interfaces by default under the ng serve section. However, in fact the server listens on 127.0.0.1 only.

Please, set the node.js to 0.0.0.0 or change the message.

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Win8.1
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.15 node: 6.6.0 os: win32 x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    ng init; ng serve
  4. The log given by the failure. Normally this include a stack trace and some
    more information.
  5. Mention any other details that might be useful.
@gyuho
Copy link

gyuho commented Sep 27, 2016

Please, set the node.js to 0.0.0.0 or change the message.

Do you know how to do that? I am facing the same issue.

@gyuho
Copy link

gyuho commented Sep 27, 2016

Nvm. Works with command ng serve --host 0.0.0.0

@slavafomin
Copy link

slavafomin commented Aug 23, 2017

Hello!

I've launched ng serve using the command above, but when I'm trying to access the server through public IP address, I'm getting the error: Invalid Host header. How do I overcome this? How do I make it accept any host header?

Thank you!

@slavafomin
Copy link

The full command should look like this: $ ng serve --port 8080 --host 0.0.0.0 --disable-host-check, the --disable-host-check option will allow to use any host header. The following thread, could also be useful: #6349.

@DiegoPadillaZ
Copy link

ng serve --port 8080 --host 0.0.0.0

This solution works fine

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants