-
Notifications
You must be signed in to change notification settings - Fork 12k
ng serve doesn't listen other than localhost #2375
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
Comments
This also doesn't serve via remote machines.
|
I found the cause. It's binding static IP I am not sure what npm package does this... :(
It should be something like
|
Works with command |
@gyuho Hi have you found the cause which package or making the app bind to 127.0.0.1 and not other IPs? I have to run --host 0.0.0.0 as well to make it work on VM. |
@estradamarkie I have no idea :0 |
#3101 I posted a similar issue this might help clear things up :) |
ng serve --host 0.0.0.0 worked. Thanks |
Thanks, this drove me crazy. |
Thanks, it is helpful to write |
Thanks It worked :D ng serve --host 0.0.0.0 |
Whats the reason behind 127.0.0.1 this is just unnecessary most people probably want to test their apps on mobile too. And accessing the dev environment over lan is the easiest way to do so. Can we make the 0.0.0.0 to be the default please? @gyuho |
Invalid Host header. still not solved by ng serve --host 0.0.0.0 |
@sshreya0808 I may have had the same "Invalid Host Header" problem as you did. The cause of this problem may or may not have been because AWS remote server/VPS has some default firewalls/security settings that may happen to obstruct simply testing Angular's CLI-installed "Welcome to app!" page. |
@levivel |
None of these helped. My browser tab continues to spin with no errors in the dev tool Network tab in Chrome. I disabled private and domain firewalls. I'm out of ideas. Anyone can help me troubleshoot this? Greatly appreciated! Windows 10 Creators Update
|
Thanks for this , this option worked for me in my ubuntu remote: ng serve --host 0.0.0.0 |
Also worked for me by ading |
thanks it worked for me as well |
@ninjadev1030 solution with |
Thanks, it works now, as it drives me crazy for several days. |
@ludwigliu , @lgoyal06 , @rohit2219 , Can anyone of you please explain how you fix it? I try modification in the .angular-cli.json: "serve": { |
@levivel You solved my problem thanks, how can I fix it permanently without changing host/port. Im using different cloud service, but I assume it can apply to my service. |
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. |
Ubuntu 16.04
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:do on your code? etc.
I have this app https://github.com/jelbourn/material2-app.
And just type
npm start
in repository root. Both in remote and local machine, I seeBut when I try to connect to
http://[PUBLIC_IP_ADDRESS_OF_CLOUD]:4200
, it doesn't serve. I checked all network settings (I am using Google Cloud VM) and confirm that there's no firewall blocking:4200
.Same simple webserver in Go listening to
:4200
works fine on the same machine.Is there anything that I am missing to deploy angular app in virtual machines?
The text was updated successfully, but these errors were encountered: