cli-tunnel 1.3.1-beta.6 → 1.3.1-beta.7

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/index.js CHANGED
@@ -564,7 +564,8 @@ wss.on('connection', (ws, req) => {
564
564
  });
565
565
  ws.on('close', () => connections.delete(id));
566
566
  });
567
- // F-10: WS heartbeat — ping every 30s, close unresponsive after 10s
567
+ // F-10: WS heartbeat — ping every 2 minutes, close unresponsive connections
568
+ // Longer interval prevents killing phone connections that go to background briefly
568
569
  setInterval(() => {
569
570
  for (const [id, ws] of connections) {
570
571
  if (ws._isAlive === false) {
@@ -575,7 +576,7 @@ setInterval(() => {
575
576
  ws._isAlive = false;
576
577
  ws.ping();
577
578
  }
578
- }, 30000);
579
+ }, 120000);
579
580
  function broadcast(data) {
580
581
  const redacted = redactSecrets(data);
581
582
  const msg = JSON.stringify({ type: 'pty', data: redacted });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli-tunnel",
3
- "version": "1.3.1-beta.6",
3
+ "version": "1.3.1-beta.7",
4
4
  "description": "Tunnel any CLI app to your phone — PTY + devtunnel + xterm.js",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/remote-ui/app.js CHANGED
@@ -404,7 +404,7 @@
404
404
 
405
405
  // ─── Grid View (multi-terminal with layout modes) ───────────
406
406
  function showGridView(sessions) {
407
- var connectable = sessions.filter(function(s) { return s.online && s.token; });
407
+ var connectable = sessions.filter(function(s) { return s.online && s.hasToken; });
408
408
  if (connectable.length === 0) return;
409
409
 
410
410
  // Clean up previous grid
@@ -1024,7 +1024,7 @@
1024
1024
  ws.onclose = () => {
1025
1025
  if (isRecording) { stopRecording(); var btn = document.getElementById('btn-record'); if (btn) { btn.classList.remove('recording'); btn.textContent = '⏺'; btn.title = 'Record terminal'; } }
1026
1026
  connected = false; acpReady = false; sessionId = null;
1027
- setStatus('offline', 'Disconnected');
1027
+ setStatus('offline', 'Reconnecting...');
1028
1028
  const delay = Math.min(30000, 1000 * Math.pow(2, reconnectAttempt)) + Math.random() * 1000;
1029
1029
  reconnectAttempt++;
1030
1030
  setTimeout(connect, delay);
@@ -1038,6 +1038,14 @@
1038
1038
  };
1039
1039
  }
1040
1040
 
1041
+ // Reconnect immediately when phone comes back from background
1042
+ document.addEventListener('visibilitychange', function() {
1043
+ if (!document.hidden && !connected && !isHubMode) {
1044
+ reconnectAttempt = 0;
1045
+ connect();
1046
+ }
1047
+ });
1048
+
1041
1049
  // ─── Message Handler ─────────────────────────────────────
1042
1050
  function handleMessage(msg) {
1043
1051
  // Replay events from bridge recording
@@ -42,8 +42,6 @@
42
42
  <button data-key="\x03">Ctrl+C</button>
43
43
  <button data-key=" ">Space</button>
44
44
  <button data-key="\x7f">⌫</button>
45
- <button id="btn-record" data-action="toggle-record" title="Record terminal" aria-label="Record terminal">⏺</button>
46
- <button id="btn-screenshot" data-action="take-screenshot" title="Screenshot terminal" aria-label="Screenshot terminal">📷</button>
47
45
  </div>
48
46
  <form id="input-form">
49
47
  <span class="prompt">&gt;</span>