fix: force cloudflared to use http2 to resolve UDP/QUIC connectivity issues

This commit is contained in:
ssbg04 committed 2026-08-23 23:37:55 +08:00
1 parent 79cc152f33
commit ff03b30c02
1 file changed
+3 -3
+3 -3
View File
@@ -131,10 +131,10 @@ async function startTunnel() {
const port = process.env.PORT || 18484;
const args = token
? ['tunnel', 'run', '--token', token]
: ['tunnel', '--url', `http://localhost:${port}`];
? ['tunnel', '--protocol', 'http2', 'run', '--token', token]
: ['tunnel', '--protocol', 'http2', '--url', `http://localhost:${port}`];
console.log(`[Tunnel] Launching Cloudflare tunnel: "${binPath}" ${token ? 'tunnel run --token [CONFIGURED]' : args.join(' ')}`);
console.log(`[Tunnel] Launching Cloudflare tunnel: "${binPath}" ${token ? 'tunnel --protocol http2 run --token [CONFIGURED]' : args.join(' ')}`);
tunnelState = 'starting';
try {