Dynamic ws protocol (#11757)

This commit is contained in:
Amir Omidi
2020-08-11 14:04:35 -07:00
committed by GitHub
parent f45583c0f6
commit 3432743f63

View File

@@ -208,7 +208,7 @@ export class BrowserSocketFactory implements ISocketFactory {
}
connect(host: string, port: number, query: string, callback: IConnectCallback): void {
const socket = this._webSocketFactory.create(`ws://${host}:${port}/?${query}&skipWebSocketFrames=false`);
const socket = this._webSocketFactory.create(`${location.protocol === 'https:' ? 'wss' : 'ws'}://${host}:${port}/?${query}&skipWebSocketFrames=false`); // {{SQL CARBON EDIT}} # dynamic websocket protocol
const errorListener = socket.onError((err) => callback(err, undefined));
socket.onOpen(() => {
errorListener.dispose();