fix: 按 K-00 约定修复 JS SDK 断线重交与退避

This commit is contained in:
Nixevol
2026-09-30 16:24:13 +08:00
parent f6f8ccf269
commit 55aa0ccf53
10 changed files with 1049 additions and 184 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ const pass = process.env.NIXMSG_PASSWORD || "secret";
const peer = process.env.NIXMSG_PEER || "device-2";
const c = new Client();
c.onSessionHandler((tok) => console.log("session", tok));
c.onSessionHandler((tok) => console.log("session", String(tok).slice(0, 8)));
c.onMessageHandler((msg) => console.log("msg", msg.from, msg.body.data));
c.onConnectionHandler((ev) => console.log("conn", ev.state, ev.reason));