Skip to content

Commit 9301699

Browse files
alan-agius4dgp1130
authored andcommitted
fix(@angular-devkit/build-angular): replace dev-server socket path from /ws to /ng-cli-ws
In some cases `/ws` caused conflicts with local websocket connections. Hence we change the dev-server web socket path to something more specific to the Angular CLI. Closes #23260
1 parent 711aa7f commit 9301699

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/angular_devkit/build_angular/src/builders/dev-server/specs/live-reload_spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ function createProxy(target: string, secure: boolean, ws = true): ProxyInstance
9595

9696
async function goToPageAndWaitForWS(page: Page, url: string): Promise<void> {
9797
const baseUrl = url.replace(/^http/, 'ws');
98-
const socksRequest = baseUrl[baseUrl.length - 1] === '/' ? `${baseUrl}ws` : `${baseUrl}/ws`;
98+
const socksRequest =
99+
baseUrl[baseUrl.length - 1] === '/' ? `${baseUrl}ng-cli-ws` : `${baseUrl}/ng-cli-ws`;
99100
// Create a Chrome dev tools session so that we can capturing websocket request.
100101
// https://github.com/puppeteer/puppeteer/issues/2974
101102

packages/angular_devkit/build_angular/src/webpack/configs/dev-server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function getWebSocketSettings(
298298
};
299299
}
300300

301-
const webSocketPath = posix.join(servePath, 'ws');
301+
const webSocketPath = posix.join(servePath, 'ng-cli-ws');
302302

303303
return {
304304
webSocketServer: {

0 commit comments

Comments
 (0)