plugins-workspace
plugins-workspace copied to clipboard
websocket connection error
try {
this.ws = TauriWebSocket.connect(this.addr);
(this.ws as Promise<TauriWebSocket>).then((ws) => {
setTimeout(() => {
if (this._onOpen) {
alert("opened")
this._onOpen();
}
}, 500);
const unListener= ws.addListener((message) => {
alert(
`message type: ${message.type} content: ${message.data} ${message}`
);
if (message.type === 'Close') {
if (this._onClose) {
this._onClose(message.data as CloseEvent);
unListener()
}
}
});
});
} catch (e: any) {
alert('exception:' + e.message);
if (this._onClose) {
this._onClose();
}
}
Do you think you can come up with a full (minimal) reproduction repo for us to try? This feels impossible to triage x)
Also, please share the output of the tauri info command for completeness sake.
i use custom websocket connector and implement ping and pong then fixed this issue