api-response-manager 2.6.1 → 2.6.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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Command-line interface for API Response Manager. Manage tunnels, webhooks, and projects from your terminal.
8
8
 
9
- **Version:** 2.6.0 | **Live Service:** https://tunnelapi.in
9
+ **Version:** 2.6.2 | **Live Service:** https://tunnelapi.in
10
10
 
11
11
  ## Installation
12
12
 
package/commands/serve.js CHANGED
@@ -454,7 +454,10 @@ async function connectFileTunnel(tunnelId, subdomain, localPort) {
454
454
  function connect() {
455
455
  if (isShuttingDown) return;
456
456
 
457
- const ws = new WebSocket(tunnelServerUrl);
457
+ const ws = new WebSocket(tunnelServerUrl, {
458
+ // Keep connection alive with WebSocket-level ping/pong
459
+ perMessageDeflate: false
460
+ });
458
461
 
459
462
  ws.on('open', () => {
460
463
  reconnectAttempts = 0; // Reset on successful connection
@@ -476,12 +479,17 @@ async function connectFileTunnel(tunnelId, subdomain, localPort) {
476
479
  clearInterval(heartbeatInterval);
477
480
  }
478
481
 
479
- // Heartbeat every 15 seconds to keep connection alive
482
+ // Heartbeat every 10 seconds to keep connection alive during large transfers
480
483
  heartbeatInterval = setInterval(() => {
481
484
  if (ws.readyState === WebSocket.OPEN) {
482
485
  ws.send(JSON.stringify({ type: 'heartbeat', tunnelId, subdomain }));
483
486
  }
484
- }, 15000);
487
+ }, 10000);
488
+ });
489
+
490
+ // Respond to WebSocket-level ping from server
491
+ ws.on('ping', () => {
492
+ ws.pong();
485
493
  });
486
494
 
487
495
  ws.on('message', async (data) => {
@@ -524,7 +532,7 @@ async function connectFileTunnel(tunnelId, subdomain, localPort) {
524
532
  validateStatus: () => true,
525
533
  responseType: 'arraybuffer',
526
534
  maxRedirects: 0,
527
- timeout: 30000
535
+ timeout: 0 // No timeout for large file transfers
528
536
  });
529
537
 
530
538
  const cleanHeaders = { ...response.headers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-response-manager",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "Command-line interface for API Response Manager",
5
5
  "main": "index.js",
6
6
  "bin": {