-
Notifications
You must be signed in to change notification settings - Fork 12k
Wrong SockJS Host validation with Reverse Proxy #13627
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
I also faced this problem. @mistic100 This might help: Brief description of project setup:
Command: SockJs tries to connect via: If I try the command: This worked! (Kinda)Out of desperation, I also tried:
After some searching, I stumbled across this issue. Turns out I had to manually enable the websocket protocol in IIS. TLDR;
* Question to the experts working on angular-cli: |
@EdwinChua No, you shouldn't have to do that. It appears that the Webpack-dev-server drops the |
@clydin Is that a bug I should report then? Or should I be doing something differently? |
…th public host option If a custom path is provided the webpack dev server client drops the sockjs-node segment. This adds it back so that behavior is consistent when using a custom URL path. Fixes angular#13627
…th public host option If a custom path is provided the webpack dev server client drops the sockjs-node segment. This adds it back so that behavior is consistent when using a custom URL path. Fixes angular#13627
…th public host option If a custom path is provided the webpack dev server client drops the sockjs-node segment. This adds it back so that behavior is consistent when using a custom URL path. Fixes angular#13627
…th public host option If a custom path is provided the webpack dev server client drops the sockjs-node segment. This adds it back so that behavior is consistent when using a custom URL path. Fixes #13627
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
Angular CLI version : 7.2.3
Command (mark with an
x
)Is this a regression?
I don't know
Description
When using "ng serve" behind a reverse proxy on a sub-path, the SockJS Server throws 400 errors because it fails to validate the Host/Origin header.
🔬 Minimal Reproduction
I want to have my application served on my workstation at
http://dev.local/common-demo
serve
task inangular.json
with🔥 Exception or Error
Chrome console shows :
Notes
If I set
disableHostCheck
totrue
, it works, but I don't want to.If I set
publicHost
todev.local
the app tries to connect tows://dev.local/sockjs-node
which is not valid as it ignores thebaseHref
.The
servePath
needs to be/
as the app is served at the root oflocalhost:9038
(by defaultservePath
inherits frombaseHref
but the sub-path is handled by the Reverse Proxy in my setup).The text was updated successfully, but these errors were encountered: