connection issue fix

This commit is contained in:
rosetta
2026-01-31 04:07:29 +02:00
parent 9a24ee2cf4
commit 22a1fd3a1a
2 changed files with 2 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ export function ProtocolProvider(props : ProtocolProviderProps) {
deviceName: systemInfo.name, deviceName: systemInfo.name,
deviceOs: systemInfo.os deviceOs: systemInfo.os
} }
protocol.connect();
protocol.startHandshakeExchange(publicKey, privateKey, device); protocol.startHandshakeExchange(publicKey, privateKey, device);
protocol.on('connect', () => { protocol.on('connect', () => {
protocol.startHandshakeExchange(publicKey, privateKey, device); protocol.startHandshakeExchange(publicKey, privateKey, device);

View File

@@ -131,7 +131,7 @@ export default class Protocol extends EventEmitter {
return this._packetWaiters.get(packetId)!; return this._packetWaiters.get(packetId)!;
} }
private connect() { public connect() {
this.socket = new WebSocket(this.serverAddress); this.socket = new WebSocket(this.serverAddress);
this.socket.addEventListener('open', () => { this.socket.addEventListener('open', () => {