Improve running on https
This commit is contained in:
parent
a67d90abd0
commit
6b1a058a88
|
@ -240,7 +240,8 @@ export class BrowserSocketFactory implements ISocketFactory {
|
|||
}
|
||||
|
||||
connect(host: string, port: number, query: string, callback: IConnectCallback): void {
|
||||
const socket = this._webSocketFactory.create(`ws://${/:/.test(host) ? `[${host}]` : host}:${port}/?${query}&skipWebSocketFrames=false`);
|
||||
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
|
||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}/?${query}&skipWebSocketFrames=false`);
|
||||
const errorListener = socket.onError((err) => callback(err, undefined));
|
||||
socket.onOpen(() => {
|
||||
errorListener.dispose();
|
||||
|
|
|
@ -63,7 +63,8 @@ export class RemoteAuthorityResolverService extends Disposable implements IRemot
|
|||
const pieces = authority.split(':');
|
||||
return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken } };
|
||||
}
|
||||
return { authority: { authority, host: authority, port: 80, connectionToken } };
|
||||
const port = (/^https:/.test(window.location.href) ? 443 : 80);
|
||||
return { authority: { authority, host: authority, port: port, connectionToken } };
|
||||
}
|
||||
|
||||
_clearResolvedAuthority(authority: string): void {
|
||||
|
|
Loading…
Reference in a new issue