opentunnel-cli 1.0.30 → 1.0.32
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 +44 -0
- package/dist/cli/index.js +13 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/client/TunnelClient.d.ts +2 -0
- package/dist/client/TunnelClient.d.ts.map +1 -1
- package/dist/client/TunnelClient.js +125 -36
- package/dist/client/TunnelClient.js.map +1 -1
- package/dist/server/TunnelServer.d.ts +3 -0
- package/dist/server/TunnelServer.d.ts.map +1 -1
- package/dist/server/TunnelServer.js +111 -33
- package/dist/server/TunnelServer.js.map +1 -1
- package/dist/shared/types.d.ts +22 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- [Server Mode](#server-mode-config)
|
|
19
19
|
- [Hybrid Mode](#hybrid-mode-config)
|
|
20
20
|
- [CLI Commands](#cli-commands)
|
|
21
|
+
- [Streaming Large Files / Video](#streaming-large-files--video)
|
|
21
22
|
- [Documentation](#documentation)
|
|
22
23
|
- [Architecture](#architecture)
|
|
23
24
|
- [Troubleshooting](#troubleshooting-quick)
|
|
@@ -144,6 +145,13 @@ tunnels:
|
|
|
144
145
|
protocol: http
|
|
145
146
|
port: 4000
|
|
146
147
|
subdomain: api
|
|
148
|
+
|
|
149
|
+
- name: media
|
|
150
|
+
protocol: http
|
|
151
|
+
port: 8080
|
|
152
|
+
subdomain: media
|
|
153
|
+
streaming: true # Enable streaming mode (10 min timeout)
|
|
154
|
+
# requestTimeout: 0 # Or no timeout (use with caution)
|
|
147
155
|
```
|
|
148
156
|
|
|
149
157
|
### Server Mode Config
|
|
@@ -219,6 +227,42 @@ tunnels:
|
|
|
219
227
|
- `-t, --token <token>` - Auth token
|
|
220
228
|
- `-n, --name <name>` - Custom subdomain
|
|
221
229
|
- `--insecure` - Skip SSL verification
|
|
230
|
+
- `--streaming` - Enable streaming mode (10 min timeout for video/large files)
|
|
231
|
+
- `--timeout <ms>` - Custom request timeout in milliseconds (0 = no timeout)
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Streaming Large Files / Video
|
|
236
|
+
|
|
237
|
+
For tunneling video streams or large file downloads, use the streaming options:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Enable streaming mode (10 minute timeout)
|
|
241
|
+
opentunnel http 8080 -s example.com --streaming
|
|
242
|
+
|
|
243
|
+
# Custom timeout (5 minutes = 300000ms)
|
|
244
|
+
opentunnel http 8080 -s example.com --timeout 300000
|
|
245
|
+
|
|
246
|
+
# No timeout (use with caution - high memory usage)
|
|
247
|
+
opentunnel http 8080 -s example.com --timeout 0
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**In configuration file:**
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
tunnels:
|
|
254
|
+
- name: media-server
|
|
255
|
+
protocol: http
|
|
256
|
+
port: 8080
|
|
257
|
+
subdomain: media
|
|
258
|
+
streaming: true # 10 min timeout
|
|
259
|
+
# requestTimeout: 300000 # Or custom timeout in ms
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
> **Note:** HTTP tunnels buffer the entire response in memory before forwarding. For very large files (>500MB), consider using TCP tunnels which stream byte-by-byte:
|
|
263
|
+
> ```bash
|
|
264
|
+
> opentunnel tcp 8080 -s example.com
|
|
265
|
+
> ```
|
|
222
266
|
|
|
223
267
|
---
|
|
224
268
|
|
package/dist/cli/index.js
CHANGED
|
@@ -238,7 +238,7 @@ program
|
|
|
238
238
|
.name("opentunnel")
|
|
239
239
|
.alias("ot")
|
|
240
240
|
.description("Expose local ports to the internet via custom domains, ngrok, or Cloudflare Tunnel")
|
|
241
|
-
.version("1.0.
|
|
241
|
+
.version("1.0.32");
|
|
242
242
|
// Helper function to build WebSocket URL from domain
|
|
243
243
|
// User only provides base domain (e.g., fjrg2007.com), system handles the rest
|
|
244
244
|
// Note: --insecure flag only affects certificate verification, not the protocol
|
|
@@ -279,6 +279,8 @@ program
|
|
|
279
279
|
.option("-h, --host <host>", "Local host to forward to", "localhost")
|
|
280
280
|
.option("-t, --token <token>", "Authentication token (if server requires it)")
|
|
281
281
|
.option("--insecure", "Skip SSL certificate verification (for self-signed certs)")
|
|
282
|
+
.option("--streaming", "Enable streaming mode (longer timeouts for video/large files)")
|
|
283
|
+
.option("--timeout <ms>", "Custom request timeout in milliseconds")
|
|
282
284
|
.option("--local-server", "Start a local server before connecting")
|
|
283
285
|
.option("--server-port <port>", "Port for the local server (default: 443)", "443")
|
|
284
286
|
.action(async (port, options) => {
|
|
@@ -377,6 +379,8 @@ program
|
|
|
377
379
|
localHost: options.host,
|
|
378
380
|
localPort: parseInt(port),
|
|
379
381
|
subdomain: options.subdomain,
|
|
382
|
+
streaming: options.streaming || false,
|
|
383
|
+
requestTimeout: options.timeout ? parseInt(options.timeout) : undefined,
|
|
380
384
|
});
|
|
381
385
|
return { client, tunnelId, publicUrl };
|
|
382
386
|
};
|
|
@@ -579,6 +583,8 @@ program
|
|
|
579
583
|
localHost: options.host,
|
|
580
584
|
localPort: parseInt(port),
|
|
581
585
|
subdomain: options.subdomain,
|
|
586
|
+
streaming: options.streaming || false,
|
|
587
|
+
requestTimeout: options.timeout ? parseInt(options.timeout) : undefined,
|
|
582
588
|
});
|
|
583
589
|
spinner.succeed("Tunnel established!");
|
|
584
590
|
console.log("");
|
|
@@ -642,6 +648,8 @@ program
|
|
|
642
648
|
.option("--server-port <port>", "Server port", "443")
|
|
643
649
|
.option("--https", "Use HTTPS for local connection")
|
|
644
650
|
.option("--insecure", "Skip SSL verification (for self-signed certs)")
|
|
651
|
+
.option("--streaming", "Enable streaming mode (longer timeouts for video/large files)")
|
|
652
|
+
.option("--timeout <ms>", "Custom request timeout in milliseconds")
|
|
645
653
|
.option("--ngrok", "Use ngrok instead of OpenTunnel server")
|
|
646
654
|
.option("--region <region>", "Ngrok region (us, eu, ap, au, sa, jp, in)", "us")
|
|
647
655
|
.option("--cloudflare, --cf", "Use Cloudflare Tunnel instead of OpenTunnel server")
|
|
@@ -687,6 +695,8 @@ program
|
|
|
687
695
|
serverUrl,
|
|
688
696
|
token: options.token,
|
|
689
697
|
insecure: options.insecure,
|
|
698
|
+
streaming: options.streaming,
|
|
699
|
+
requestTimeout: options.timeout ? parseInt(options.timeout) : undefined,
|
|
690
700
|
});
|
|
691
701
|
return;
|
|
692
702
|
}
|
|
@@ -2871,6 +2881,8 @@ async function createTunnel(options) {
|
|
|
2871
2881
|
localPort: options.localPort,
|
|
2872
2882
|
subdomain: options.subdomain,
|
|
2873
2883
|
remotePort: options.remotePort,
|
|
2884
|
+
streaming: options.streaming,
|
|
2885
|
+
requestTimeout: options.requestTimeout,
|
|
2874
2886
|
});
|
|
2875
2887
|
spinner.succeed("Tunnel established!");
|
|
2876
2888
|
printTunnelInfo({
|