lunel-cli 0.1.92 → 0.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/transport/v2.d.ts +1 -0
- package/dist/transport/v2.js +11 -0
- package/package.json +1 -1
package/dist/transport/v2.d.ts
CHANGED
package/dist/transport/v2.js
CHANGED
|
@@ -124,6 +124,7 @@ export class V2SessionTransport {
|
|
|
124
124
|
if ("type" in raw) {
|
|
125
125
|
await this.options.handlers.onSystemMessage(raw);
|
|
126
126
|
if (raw.type === "peer_connected") {
|
|
127
|
+
this.resetPeerSession();
|
|
127
128
|
await this.maybeStartHandshake();
|
|
128
129
|
}
|
|
129
130
|
return;
|
|
@@ -290,6 +291,16 @@ export class V2SessionTransport {
|
|
|
290
291
|
};
|
|
291
292
|
return this.keyPair;
|
|
292
293
|
}
|
|
294
|
+
resetPeerSession() {
|
|
295
|
+
this.remotePublicKey = null;
|
|
296
|
+
this.sessionKeys = null;
|
|
297
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
298
|
+
this.state = "open";
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
this.state = "idle";
|
|
302
|
+
}
|
|
303
|
+
}
|
|
293
304
|
computeHandshakeAuth(phase, senderRole, peerPubkeyB64, nonce, boxed) {
|
|
294
305
|
const authKey = sodium.crypto_generichash(sodium.crypto_auth_KEYBYTES, encodeUtf8(this.options.sessionCode), undefined);
|
|
295
306
|
const parts = [
|