-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed as not planned
Closed as not planned
Copy link
Description
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When serving angular 15 application behind a reverse proxy on different port, webpack dev server fails to live-reload.
Specifically, this line of code should use options.port rather than hardcoding 0
[dev-server.ts#L333](
angular-cli/packages/angular_devkit/build_angular/src/webpack/configs/dev-server.ts
Line 333 in cf2f30a
| return `auto://${publicHost || '0.0.0.0:0'}${webSocketPath}`; |
should become
return `${options.sslKey === undefined ? 'ws': 'wss'}://${publicHost || options.host}:${options.port}${webSocketPath}`;Minimal Reproduction
- Create an angular 15 application
- Serve the app :
ng serve --project teddyBear --port 4201
- Serve the app :
- Launch a reverse proxy which serves on different host and/or port and just returns the angular 15 app files.
- Even though the angular app might serve, live-reload should fail
Exception or Error
[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.
WebSocket connection to 'ws://localhost/ng-cli-ws' failed:
[webpack-dev-server] Trying to reconnect...
Your Environment
Angular CLI: 15.0.2
Node: 18.12.1
Package Manager: yarn 1.22.19
OS: darwin arm64
Angular: 15.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1500.2
@angular-devkit/build-angular 15.0.2
@angular-devkit/core 15.0.2
@angular-devkit/schematics 15.0.2
@angular/cdk 15.0.1
@schematics/angular 15.0.2
ng-packagr 15.0.1
rxjs 7.5.7
typescript 4.8.4
Anything else relevant?
No response
