api-response-manager 2.6.7 → 2.6.8

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.
Files changed (2) hide show
  1. package/commands/tunnel.js +16 -14
  2. package/package.json +1 -1
@@ -153,10 +153,14 @@ async function connectTunnelClient(tunnelId, subdomain, localPort, protocol = 'h
153
153
  console.log(chalk.white('Your local server is now accessible at:'));
154
154
  console.log(chalk.cyan.bold(` ${message.publicUrl}\n`));
155
155
 
156
- // Show TCP/SSH specific info and start local proxy
156
+ // Show TCP/SSH specific info
157
157
  if (isTcpTunnel && message.tcpHost && message.tcpPort) {
158
- // Start a local TCP proxy that transparently handles subdomain multiplexing
159
- startLocalTcpProxy(subdomain, message.tcpHost, message.tcpPort, silent);
158
+ console.log(chalk.yellow.bold('šŸ”Œ SSH/TCP Tunnel Ready!\n'));
159
+ console.log(chalk.white.bold(' šŸ“‹ Share this with anyone to connect:\n'));
160
+ console.log(chalk.cyan.bold(` ssh <user>@${message.tcpHost} -p ${message.tcpPort}\n`));
161
+ console.log(chalk.gray(' With SSH Key:'));
162
+ console.log(chalk.cyan(` ssh -i ~/.ssh/your_key <user>@${message.tcpHost} -p ${message.tcpPort}\n`));
163
+ console.log(chalk.gray.italic(' Replace <user> with the remote device\'s SSH username\n'));
160
164
  } else {
161
165
  // Display QR code for HTTP/HTTPS tunnels (not for TCP/SSH)
162
166
  displayQRCode(message.publicUrl);
@@ -275,11 +279,6 @@ async function connectTunnelClient(tunnelId, subdomain, localPort, protocol = 'h
275
279
  process.on('SIGINT', () => {
276
280
  if (heartbeatInterval) clearInterval(heartbeatInterval);
277
281
  console.log(chalk.yellow('\n\n⚠ Stopping tunnel...'));
278
- // Close local TCP proxy if running
279
- if (localProxyServer) {
280
- localProxyServer.close();
281
- localProxyServer = null;
282
- }
283
282
  ws.close();
284
283
  });
285
284
  }
@@ -619,14 +618,17 @@ function startLocalTcpProxy(subdomain, remoteHost, remotePort, silent) {
619
618
  if (!silent) {
620
619
  console.log(chalk.yellow.bold('šŸ”Œ SSH/TCP Tunnel Ready!\n'));
621
620
 
622
- console.log(chalk.white.bold(' šŸ“‹ Share this command with anyone to connect:\n'));
623
- console.log(chalk.cyan.bold(` ssh -o ProxyCommand="sh -c 'printf \\"SUBDOMAIN:${subdomain}\\\\n\\"; exec nc %h %p'" <username>@${remoteHost} -p ${remotePort}\n`));
621
+ // Build the shareable SSH command
622
+ // Uses FIFO-based ProxyCommand for bidirectional relay through the tunnel server
623
+ const sshCmd = `ssh -o "ProxyCommand=bash -c 'F=\\$(mktemp -u);mkfifo \\$F;nc %h %p <\\$F & printf SUBDOMAIN:${subdomain}\\\\\\\\n >\\$F;cat >\\$F;rm \\$F'" <user>@${remoteHost} -p ${remotePort}`;
624
+
625
+ console.log(chalk.white.bold(' šŸ“‹ Share with anyone to connect (Linux/Mac/WSL):\n'));
626
+ console.log(chalk.cyan(` ${sshCmd}\n`));
624
627
 
625
- console.log(chalk.white.bold(' šŸ’» Or connect from this machine:\n'));
626
- console.log(chalk.cyan(` ssh <username>@localhost -p ${localPort}\n`));
628
+ console.log(chalk.white.bold(' šŸ’» Connect from this machine:\n'));
629
+ console.log(chalk.cyan(` ssh <user>@localhost -p ${localPort}\n`));
627
630
 
628
- console.log(chalk.gray.italic(' Replace <username> with the device\'s SSH username'));
629
- console.log(chalk.gray.italic(' Requires: nc (netcat) — pre-installed on Linux/Mac/Windows 10+\n'));
631
+ console.log(chalk.gray.italic(' Replace <user> with the remote device\'s SSH username\n'));
630
632
  }
631
633
  });
632
634
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-response-manager",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "description": "Command-line interface for API Response Manager",
5
5
  "main": "index.js",
6
6
  "bin": {