peer-term 1.2.7 → 1.2.9
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/README.md +0 -6
- package/package.json +1 -1
- package/src/index.js +9 -1
package/README.md
CHANGED
|
@@ -14,12 +14,6 @@ This will start a terminal sharing session and give you a 6-digit code.
|
|
|
14
14
|
|
|
15
15
|
Share this code with your peer. They can view your terminal by going to https://peer-term-relay-production-9b7a.up.railway.app or https://peer-term-relay.onrender.com and entering the code.
|
|
16
16
|
|
|
17
|
-
If you started the session with `--secure`, both sides will show a short security fingerprint. Compare it over a trusted channel. If it matches, authorize the session in the host CLI:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
a <code>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
17
|
## Global Installation
|
|
24
18
|
|
|
25
19
|
If you prefer to install it globally:
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -515,6 +515,11 @@ class Session {
|
|
|
515
515
|
this.isClientConnected = true;
|
|
516
516
|
this.missedPings = 0;
|
|
517
517
|
|
|
518
|
+
if (this.useDataChannel && this.webrtc && this.webrtc.isActive()) {
|
|
519
|
+
this.startHeartbeat();
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
|
|
518
523
|
await this._beginKeyExchange();
|
|
519
524
|
break;
|
|
520
525
|
}
|
|
@@ -716,7 +721,10 @@ class Session {
|
|
|
716
721
|
if (this.useDataChannel && this.webrtc && this.webrtc.isActive()) {
|
|
717
722
|
this.webrtc.send(payload);
|
|
718
723
|
} else if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
719
|
-
|
|
724
|
+
// Backpressure: drop chunk if relay can't keep up (1.25 MB buffer limit)
|
|
725
|
+
if (this.ws.bufferedAmount < 1.25 * 1024 * 1024) {
|
|
726
|
+
this.ws.send(JSON.stringify({ type: 'data', payload }));
|
|
727
|
+
}
|
|
720
728
|
}
|
|
721
729
|
} catch {}
|
|
722
730
|
});
|