peer-term 1.4.8 → 1.4.10

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 CHANGED
@@ -63,7 +63,8 @@ While running, you can manage sessions directly from the host CLI:
63
63
  | Command | Description |
64
64
  | :--- | :--- |
65
65
  | `n` | Create a new session |
66
- | `l` | List all active sessions |
66
+ | `l` | List all active sessions and permissions (`[READ-ONLY]` vs `[INTERACTIVE]`) |
67
+ | `r <code>` | Toggle read-only / interactive mode for an active session (alias: `rt <code>`) |
67
68
  | `a <code>` | Authorize verified fingerprint (in `--secure` mode) |
68
69
  | `k <code>` | Kill a specific session |
69
70
  | `q` | Quit all sessions and exit |
@@ -74,13 +75,13 @@ While running, you can manage sessions directly from the host CLI:
74
75
  - **No Config**: Works instantly. No port forwarding or firewall configuration needed.
75
76
  - **End-to-End Encrypted**: Terminal data is encrypted locally using AES-256-GCM with ECDH P-256 key exchange. The relay never sees plaintext. A `--secure` flag enables an out-of-band fingerprint check for strict MITM protection.
76
77
  - **WebRTC P2P**: Creates a direct Peer-to-Peer connection on the same LAN for zero-latency, relay-free sessions.
77
- - **Read-Only Mode**: Guests can view your terminal but cannot type commands.
78
+ - **Live Permission Toggling & Read-Only**: Start view-only with `--readonly` or switch between Read-Only and Interactive mode on the fly with `r <code>`. Guests get instant visual badges and notifications without reconnecting.
78
79
  - **File Uploads**: Clients can drag-and-drop to securely upload files directly to `~/peerterm-uploads/` on the host machine. Fully encrypted end-to-end.
79
80
  - **Custom Start Path**: Set the starting directory with `--path`.
80
81
  - **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.
81
82
  - **Multi-Session**: Manage multiple simultaneous sessions with the interactive CLI menu.
82
83
  - **QR Code Support**: Displays a terminal QR code for instant connection from mobile or tablet devices without manually entering the code.
83
- - **Interactive Controls**: Manage sessions directly from the CLI (`n` for new session, `l` to list, `k` to kill, `a` to authorize fingerprint, `q` to quit).
84
+ - **Interactive Controls**: Manage sessions directly from the CLI (`n` for new session, `l` to list, `r <code>` to toggle permissions, `k` to kill, `a` to authorize fingerprint, `q` to quit).
84
85
 
85
86
  ## How It Works
86
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peer-term",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "license": "MIT",
5
5
  "description": "Share your terminal instantly using a 6-digit code or QR code. Encrypted. No config.",
6
6
  "repository": {
package/src/viewer.js CHANGED
@@ -107,13 +107,6 @@ export class ViewerServer {
107
107
  // Install the real data handler
108
108
  let recvBuf = '';
109
109
 
110
- // Process any leftover data that arrived after the token line
111
- if (remaining.length > 0) {
112
- handleViewerData(remaining);
113
- }
114
-
115
- socket.on('data', (chunk) => handleViewerData(chunk.toString()));
116
-
117
110
  const handleViewerData = (chunk) => {
118
111
  // Control messages start with \x00{
119
112
  if (recvBuf.length > 0 || chunk.startsWith('\x00{')) {
@@ -149,6 +142,13 @@ export class ViewerServer {
149
142
  this._onKeystroke(chunk);
150
143
  };
151
144
 
145
+ // Process any leftover data that arrived after the token line
146
+ if (remaining.length > 0) {
147
+ handleViewerData(remaining);
148
+ }
149
+
150
+ socket.on('data', (chunk) => handleViewerData(chunk.toString()));
151
+
152
152
  socket.on('close', () => {
153
153
  this._socket = null;
154
154
  this._logDebug('Host viewer disconnected.');