Basic Usage
Expose a local service by specifying the port:- Start a local reverse proxy
- Create a Cloudflare tunnel
- Register a DNS record at
<random-slug>.<base-domain> - Display an ngrok-style dashboard
Without the
--url flag, the server assigns a random slug for your tunnel hostname.Custom URL Slug
Specify a custom slug for your tunnel URL:https://my-app.<base-domain> forwarding to http://localhost:3000.
Verbose Mode
Show rawcloudflared output alongside the dashboard:
- Standard dashboard metrics
- Raw cloudflared connection logs
- Region/datacenter information from cloudflared
Runtime Dashboard
When a tunnel starts, the CLI displays an ngrok-style dashboard:Dashboard Metrics
Connection Stats
ttl: Total requests processed
opn: Currently open connections
rt1: Average response time (1 min)
rt5: Average response time (5 min)
p50: 50th percentile latency
p90: 90th percentile latency
opn: Currently open connections
rt1: Average response time (1 min)
rt5: Average response time (5 min)
p50: 50th percentile latency
p90: 90th percentile latency
Request Stream
Live HTTP requests showing:
- HTTP method and path
- Status code
- Timestamp
Real-time as requests flow through your tunnel
Region and Latency are best-effort metrics derived from cloudflared logs. They may show
n/a if cloudflared doesn’t emit region information.How It Works
Local Reverse Proxy
The CLI starts a reverse proxy on an ephemeral localhost port. This proxy:
- Forwards requests to your target port
- Tracks connection metrics
- Captures request/response data for the dashboard
Tunnel Creation
The API server:
- Creates a new Cloudflare tunnel
- Registers DNS record:
<slug>.<base-domain>→ tunnel - Returns a short-lived tunnel token
Cloudflared Process
The CLI spawns
cloudflared with the tunnel token, establishing a secure connection to Cloudflare’s edge.Automatic Cleanup
Tunnels are automatically stopped when:- You press
Ctrl+Cor sendSIGINT/SIGTERM - The CLI process exits normally
- The cloudflared process terminates
On graceful shutdown, the CLI:
- Stops the remote tunnel (removes DNS record)
- Kills the cloudflared process
- Stops the local reverse proxy
Tunnel Quotas
The server enforces a maximum number of active tunnels per user: To free up quota, stop tunnels you’re no longer using:Stale Tunnel Cleanup
If the CLI crashes or loses connectivity:- The server monitors heartbeats from all active tunnels
- Tunnels without heartbeats for 60 seconds (configurable) are marked stale
- A reaper process runs every 30 seconds to clean up stale tunnels
- DNS records are automatically removed
Examples
Local Web Server
API Development
Webhook Testing
Random URL
Next Steps
Manage Tunnels
List and stop active tunnels
Configuration
Customize API domain and behavior

