fix:fix reconnect

This commit is contained in:
2026-02-05 16:51:40 +08:00
parent 8fc9605242
commit 8cda5f6be3
2 changed files with 20 additions and 19 deletions

View File

@@ -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;