peer-term 1.1.1 → 1.1.3
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 +15 -8
- package/package.json +1 -1
- package/src/index.js +4 -4
package/README.md
CHANGED
|
@@ -36,17 +36,24 @@ peer-term --path ~/projects # starts at ~/projects
|
|
|
36
36
|
peer-term --path . # starts in current directory
|
|
37
37
|
peer-term --readonly # view-only session
|
|
38
38
|
peer-term --expiry 10m # custom expiry time
|
|
39
|
+
peer-term --relay wss://custom # use a custom relay server
|
|
39
40
|
peer-term --verbose # enable debug logging
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
## Features
|
|
43
44
|
|
|
44
45
|
- **No Config**: Works instantly. No port forwarding or firewall configuration needed.
|
|
45
|
-
- **End-to-End Encrypted**: Terminal data is encrypted locally using AES-GCM
|
|
46
|
-
- **WebRTC P2P**: Creates a direct Peer-to-Peer connection
|
|
47
|
-
- **Read-Only Mode**: Guests can view your terminal but cannot type commands
|
|
48
|
-
- **Custom Start Path**: Set the starting directory with `--path
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
- **End-to-End Encrypted**: Terminal data is encrypted locally using AES-256-GCM with ECDH P-256 key exchange. The relay never sees plaintext.
|
|
47
|
+
- **WebRTC P2P**: Creates a direct Peer-to-Peer connection on the same LAN for zero-latency, relay-free sessions.
|
|
48
|
+
- **Read-Only Mode**: Guests can view your terminal but cannot type commands.
|
|
49
|
+
- **Custom Start Path**: Set the starting directory with `--path`.
|
|
50
|
+
- **Resilient Connections**: Both host and client get a 2-minute rejoin window if their IP changes or connection drops. PTY state is fully preserved — no session restart needed.
|
|
51
|
+
- **Multi-Session**: Manage multiple simultaneous sessions with the interactive CLI menu.
|
|
52
|
+
|
|
53
|
+
## How It Works
|
|
54
|
+
|
|
55
|
+
1. **Host** registers a session on the relay and gets a 6-digit code
|
|
56
|
+
2. **Client** opens the web UI and enters the code
|
|
57
|
+
3. Both sides perform an **ECDH key exchange** to derive a shared AES-256-GCM secret
|
|
58
|
+
4. All terminal I/O is encrypted end-to-end — the relay only forwards opaque blobs
|
|
59
|
+
5. If both peers are on the same LAN, a **WebRTC DataChannel** is established to bypass the relay entirely
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -594,13 +594,13 @@ class Session {
|
|
|
594
594
|
this.reconnectTimer = setInterval(() => {
|
|
595
595
|
attempts++;
|
|
596
596
|
if (attempts > maxAttempts) {
|
|
597
|
-
this.log('
|
|
597
|
+
this.log('Could not reconnect. Session expired.');
|
|
598
598
|
this._stopReconnecting();
|
|
599
599
|
this.destroy();
|
|
600
600
|
return;
|
|
601
601
|
}
|
|
602
602
|
|
|
603
|
-
this.log(
|
|
603
|
+
this.log(`Reconnect attempt ${attempts}/${maxAttempts}...`);
|
|
604
604
|
|
|
605
605
|
// Close any in-flight reconnect socket from the previous tick
|
|
606
606
|
if (this._pendingReconnectWs) {
|
|
@@ -629,7 +629,7 @@ class Session {
|
|
|
629
629
|
this._pendingReconnectWs = null;
|
|
630
630
|
this.ws = newWs;
|
|
631
631
|
this._stopReconnecting();
|
|
632
|
-
this.log(
|
|
632
|
+
this.log(`Reconnected. Session restored.`);
|
|
633
633
|
|
|
634
634
|
// Re-attach the full message handler by wiring up events
|
|
635
635
|
this._attachWsHandlers(newWs);
|
|
@@ -782,7 +782,7 @@ class Session {
|
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
case 'rejoined': {
|
|
785
|
-
this.log(
|
|
785
|
+
this.log(`Reconnected. Session restored. (code: ${msg.code})`);
|
|
786
786
|
if (this.isClientConnected) {
|
|
787
787
|
this.startHeartbeat();
|
|
788
788
|
}
|