plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

websocket connection error

Open LinboLen opened this issue 3 months ago • 1 comments

Image Image

 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();
        }
      }

LinboLen avatar Sep 07 '25 09:09 LinboLen

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.

FabianLars avatar Sep 08 '25 09:09 FabianLars

i use custom websocket connector and implement ping and pong then fixed this issue

LinboLen avatar Nov 27 '25 02:11 LinboLen