From 4242c508c1af0bd171e3544cf0e652ae280d52d5 Mon Sep 17 00:00:00 2001 From: weishu Date: Wed, 4 Feb 2026 10:28:08 +0800 Subject: [PATCH] docs: update Cloudflare Tunnel section and add relay TCP configuration tip - Remove Quick Tunnel (TryCloudflare) documentation as it doesn't support SSE which HAPI uses for real-time updates - Add warning note explaining the limitation with link to Cloudflare docs - Keep only Named Tunnel as the recommended approach - Add tip about HAPI_RELAY_FORCE_TCP environment variable for users experiencing connectivity issues --- docs/guide/installation.md | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 47a4f552..6b454a31 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -135,6 +135,8 @@ The terminal displays a URL and QR code. Scan to access from anywhere. - No configuration needed - Works behind NAT, firewalls, and any network +> **Tip:** The relay uses UDP by default. If you experience connectivity issues, set `HAPI_RELAY_FORCE_TCP=true` to force TCP mode. + ### Local Only ```bash @@ -243,23 +245,13 @@ If you prefer not to use the public relay (e.g., for lower latency or self-manag https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/ -**Quick tunnel** (temporary URL, changes on restart): +> **Note:** Cloudflare Quick Tunnels (TryCloudflare) are not supported because they [do not support SSE](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/), which HAPI uses for real-time updates. Use a Named Tunnel instead. + +**Named tunnel setup:** ```bash # Install cloudflared: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/ -cloudflared tunnel --protocol http2 --url http://localhost:3006 -``` -Copy the generated URL and set it: - -```bash -export HAPI_PUBLIC_URL="https://your-tunnel.trycloudflare.com" -hapi hub -``` - -**Named tunnel** (persistent URL): - -```bash # Create and configure a named tunnel cloudflared tunnel create hapi cloudflared tunnel route dns hapi hapi.yourdomain.com @@ -268,7 +260,7 @@ cloudflared tunnel route dns hapi hapi.yourdomain.com cloudflared tunnel --protocol http2 run hapi ``` -> **Note:** Use `--protocol http2` instead of QUIC (the default) to avoid potential timeout issues with long-lived connections. +> **Tip:** Use `--protocol http2` instead of QUIC (the default) to avoid potential timeout issues with long-lived connections.