fix:fix reconnect
This commit is contained in:
@@ -85,6 +85,9 @@ export class RemoteApp {
|
||||
}
|
||||
getWsURL(url: string) {
|
||||
const { protocol } = new URL(url);
|
||||
if (protocol.startsWith('ws')) {
|
||||
return url.toString()
|
||||
}
|
||||
const wsProtocol = protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
const wsURL = url.toString().replace(protocol, wsProtocol);
|
||||
return wsURL;
|
||||
@@ -106,6 +109,7 @@ export class RemoteApp {
|
||||
ws.onopen = function () {
|
||||
that.isConnected = true;
|
||||
that.onOpen();
|
||||
console.log('[remote-app] WebSocket connection opened');
|
||||
};
|
||||
ws.onclose = function () {
|
||||
that.isConnected = false;
|
||||
|
||||
Reference in New Issue
Block a user