-
Notifications
You must be signed in to change notification settings - Fork 12k
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 development server - app connecting to localhost:3000/sockjs-node/info when behind reverse proxy #6440
Comments
Hi @koen-serneels , You are seeing localhost on your request because you are accessing the website in your browser via http://localhost:3000. Could you try and access it using your local network address e.g: http://192.168.1.2:3000 |
it breaks live reloading.. |
@RicardoVaranda Yes I did exactly that accessing it from another machine using the ip address of the RP on which also the dev server is running (RP and dev server run on the same machine). See my post, I was not using localhost |
Hey, any update regarding this issue? I am using the angular-cli so can't change webpack config. I am also having the same issue. |
This problem appears to go away when I remove the port declaration from the URL. What might fix this for everyone is to have the code smart enough to not include the port in the URL if a FQDN is used. Such as: 127.0.0.1 would include :4200 and dev.mywebsite.com would not. |
I'm having the opposite problem of this now. instead of listening to locahost:4200 which did work with our reverse proxy setting, in older version of the cli. Now in 1.5.0 it seems to build the sockjs-node server url, from the url in the browser. Which breaks because we have everything running in a folder. I've tried numerous setting an no matter what I do I cannot force the url it listens to to anything other than |
Update I found I could set this setting with the flag
|
If anyone still having this problem, when you deploy your code to production environment, set
So that it will not reload in the production environment, this is not recommended for local since your changes don't reload automatically in local, but highly recommended for production environment. |
@TheOriginalJosh Setting the public host flag worked for me! Didn't need to disable host check and had to removed the back slashes from the url.
|
@SimonHawesome nice! I had the backslashes in there since it was part of the package.json scripts. glad this worked for you. |
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. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.1.0-rc.0
node: 7.7.3
os: linux x64
@angular/cli: 1.1.0-rc.0
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/compiler-cli: 4.1.3
Linux (Ubuntu)
Details
Hi. I'm using the NG development server behind an apache reverse proxy to avoid security domain/cors issues between our front and backend. With rc0 and '--disable-host-check' this all seems to work perfectly. Expect that I see following errors reported in the browser: GET http://localhost:3000/sockjs-node/info?t=1495632403818 net::ERR_CONNECTION_REFUSED
The URL int he browser is not localhost, but that of the reverse proxy:" thttp://proxhost/..." . Might the localhost be due to some absolute path present somewhere in the NG development server? Afaic it does not seem to break anything. I start the server like this: ng serve --host 0.0.0.0 --port 3000 --disable-host-check
The text was updated successfully, but these errors were encountered: