From b257c60636f5d1f767e3e37f53070fe9af873b48 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 8 Aug 2019 11:59:07 -0500 Subject: [PATCH] Fix websocket defaulting to port 80 when authority has no port --- scripts/vscode.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vscode.patch b/scripts/vscode.patch index f9a9192c..cf44076b 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -619,7 +619,7 @@ index d39c5877d6..c189d6f19f 100644 const rootPath = path.dirname(getPathFromAmdModule(require, '')); diff --git a/src/vs/platform/remote/browser/browserWebSocketFactory.ts b/src/vs/platform/remote/browser/browserWebSocketFactory.ts -index 6d9ecbcf5a..1b3499dddf 100644 +index 6d9ecbcf5a..a3eb980965 100644 --- a/src/vs/platform/remote/browser/browserWebSocketFactory.ts +++ b/src/vs/platform/remote/browser/browserWebSocketFactory.ts @@ -79,7 +79,7 @@ class BrowserSocket implements ISocket { @@ -627,7 +627,7 @@ index 6d9ecbcf5a..1b3499dddf 100644 connect(host: string, port: number, query: string, callback: IConnectCallback): void { const errorListener = (err: any) => callback(err, undefined); - const socket = new WebSocket(`ws://${host}:${port}/?${query}&skipWebSocketFrames=false`); -+ const socket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${host}:${port}${window.location.pathname.replace(/\/+$/, '')}/?${query}&skipWebSocketFrames=false`); ++ const socket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}${window.location.pathname}?${query}&skipWebSocketFrames=false`); socket.onopen = function (event) { socket.removeEventListener('error', errorListener); callback(undefined, new BrowserSocket(socket));