docs: add ngrok vs Cloudflare Tunnel comparison for Twilio tunneling

This commit is contained in:
2026-09-02 22:59:25 -04:00
parent 52ddfd9f57
commit b899659e13
+22
View File
@@ -1101,4 +1101,26 @@ mkdir -p /home/ff/.claude/projects/-home-ff-Desktop-DentalManagementMH06/memory/
cp -r /media/usb/claude-memory-backup/* /home/ff/.claude/projects/-home-ff-Desktop-DentalManagementMH06/memory/
```
---
## ngrok vs. Cloudflare Tunnel (for exposing Twilio webhooks/streams)
Twilio just needs a public HTTPS/WSS endpoint to reach — either tunnel provider works, and neither
is required by name. Trade-offs when choosing between them for the public tunnel (`CLOUDFLARE_HOST`
today; the code doesn't actually validate it's a Cloudflare domain, it's just named that way):
| | Cloudflare Tunnel (current setup) | ngrok |
|---|---|---|
| **Fixed hostname** | Yes — same subdomain forever, survives reboots | Only on a paid static domain; **free tier assigns a new random subdomain every time the `ngrok` process restarts** (machine reboot, crash, manual relaunch) |
| **Auto-start on boot** | Already set up via `systemctl enable cloudflared` | Possible (systemd service), but only fixes the tunnel coming back up — it does **not** stop the free-tier URL from changing on each restart |
| **After a URL change** | N/A — doesn't happen | Must update `CLOUDFLARE_HOST` in `.env`, restart the backend, and update the URL(s) configured in the Twilio Console |
| **Setup cost** | One-time per office (already documented above) | Quick to spin up for local dev/testing |
| **Latency to Twilio** | No reliable general winner — depends on actual network path (nearest PoP, peering) for this specific office, not the provider's name. Cloudflare's edge network is larger/more distributed in general, but the only way to know for a given office is to measure real round-trip time, not assume | |
| **Best for** | Production / long-running office deployments | Local dev/testing, or short-lived debugging sessions |
**Bottom line:** ngrok is fine for local development, but for an office's live Twilio integration
(webhooks and any Media Stream WebSocket), the Cloudflare Tunnel setup above is preferred because
its hostname doesn't change across reboots — avoiding the reconfigure-`.env`-and-Twilio-Console
cycle that free-tier ngrok requires every time the tunnel restarts.
The memory is plain markdown files and can also be copied manually via a USB drive or file manager. Enable "show hidden files" (Ctrl+H) in the file manager to see the `.claude` folder.