Tunneling Options - pratikchaudhari64/personal_devserver GitHub Wiki
Tunneling Options
Overview
Tunneling exposes your local server (localhost:8000) to the internet.
ngrok
Free Tier
# Random URL each time
ngrok http 8000
Pros: Quick setup, no account needed Cons: URL changes, limited time
Paid Tier
# Custom subdomain
ngrok http --domain=myapp.ngrok.io 8000
# Basic auth
ngrok http 8000 --auth="user:password"
Cloudflare Tunnel
Setup
# Install
brew install cloudflare/cloudflare/cloudflared
# Login
cloudflared tunnel login
# Create tunnel
cloudflared tunnel create my-devserver
# Run
cloudflared tunnel --url http://localhost:8000
With Config File
# ~/.cloudflared/config.yml
tunnel: my-devserver
ingress:
- hostname: dev.mydomain.com
service: http://localhost:8000
- service: http_status:404
Tailscale Funnel
# Install Tailscale first
tailscale funnel 8000
Pros: Persistent URL, free Cons: Requires Tailscale account
LocalTunnel
npm install -g localtunnel
lt --port 8000 --subdomain myapp
URL: https://myapp.loca.lt
Bore
bore local 8000 --to bore.pub
Simple, no signup required.
Comparison
| Tool | Custom Domain | Free Tier | Persistent URL | Auth |
|---|---|---|---|---|
| ngrok | Paid only | Yes (limited) | Paid only | Yes |
| Cloudflare | Yes | Yes | Yes | Yes |
| Tailscale | No | Yes | Yes | Yes |
| LocalTunnel | Subdomain | Yes | Sometimes | No |
| Bore | No | Yes | No | No |
Security Tips
-
Always use auth for sensitive projects:
ngrok http 8000 --auth="user:pass" -
Whitelist IPs when possible:
ngrok http 8000 --cidr-allow 192.168.1.0/24 -
Use HTTPS (automatic with most tunnels)
-
Monitor access:
# ngrok dashboard http://localhost:4040
Which to Choose?
- Quick demo: ngrok free
- Long-term project: Cloudflare Tunnel
- Team access: Tailscale
- Simple/temp: Bore or LocalTunnel