Skip to content

Repository files navigation

cfproxy

Expose localhost to the internet with a full HTTP debugger in your terminal.

Built on Cloudflare Tunnels. Single binary. No account required.

cfproxy screenshot

Features

Per-request inspectionLive headers, body, timing, IP, user agent
Request replayReplay to localhost or back through the tunnel
Request diffMark two requests, compare side by side
Mock responsesStub endpoints from the CLI
HAR exportExport traffic for browser devtools
cURL exportCopy any request as a cURL command
Custom domainsYour own domain with wildcard subdomains
HTTP Basic AuthProtect your tunnel with --auth
WebSocket supportInspect WS frames in real time
QR codesScan to test on mobile instantly
Auto cloudflaredDownloads and caches cloudflared for you

Install

From source (recommended)

brew install rust # if you don't have Rust/Cargo yet
cargo install cfproxy
cfproxy 3000

From release binaries

Download a prebuilt binary from Releases. On macOS, you'll need to remove the quarantine flag since the binary isn't signed:

xattr -d com.apple.quarantine cfproxy

Build from source

git clone https://github.com/gitrc/cfproxy.git
cd cfproxy
cargo build --release
# Binary is at target/release/cfproxy

Quick Start

Free mode (no account needed)

cfproxy 3000

Uses your existing cloudflared or downloads it automatically, creates a tunnel to localhost:3000, and gives you a public trycloudflare.com URL with a live request dashboard.

Custom domain (free Cloudflare account)

cfproxy --setup # one-time: walks you through API token, account, zone, tunnel
cfproxy --host myapp 3000 # tunnel on myapp.yourdomain.com

Run multiple services simultaneously — each --host gets its own subdomain on your domain, all sharing one tunnel.

Why cfproxy

As of March 2026, tools like ngrok, bore, ytunnel, and tuinnel each cover tunneling well, but none give you full per-request HTTP inspection in the terminal. ytunnel and tuinnel show aggregate Prometheus metrics only. ngrok has a web inspector, but locks replay and auth behind paid tiers.

cfproxy is the only free tool that combines tunneling with a terminal HTTP debugger:

  • Per-request inspection — see every request's headers, body, timing, IP, and user agent live
  • Request replay — replay any captured request to localhost or back through the tunnel
  • Request diff — mark two requests and compare them side by side
  • Mock responses — stub endpoints from the CLI without touching your server (--mock "/api/health:200")
  • HAR export — export captured traffic for use with browser devtools or other tools
  • cURL export — copy any request as a ready-to-run cURL command
  • Custom domains — use your own domain with wildcard subdomains, free via Cloudflare
  • QR code — scan with your phone to test on mobile instantly

All in a single Rust binary with no runtime dependencies.

Key Bindings

Request List

KeyAction
j / k / Up / DownNavigate requests
EnterOpen request detail
cCopy tunnel URL to clipboard
CCopy selected request as cURL
eExport requests to HAR file
/Filter requests by path, method, status, type, IP, or user agent
SpaceMark request (for diff)
dDiff marked vs selected request
wWatch / unwatch selected path
sShow QR code
SOpen settings
hShow help
qQuit

Request Detail

KeyAction
Tab / l / RightNext tab (Request / Response / Info / WS Frames)
Shift+Tab / H / LeftPrevious tab
cCopy request as cURL
rReplay request to localhost
RReplay request to tunnel URL
mMock this endpoint
j / k / Up / DownScroll
Esc / Backspace / qBack to list

CLI

FlagEnv VariableDescription
<PORT>--Local port to expose
--auth <USER:PASS>CFPROXY_AUTHEnable HTTP Basic Auth
--mock <SPEC>CFPROXY_MOCKMock response ([METHOD] /path:status[:body]), repeatable
--host <NAME>CFPROXY_HOSTCustom subdomain (requires --setup first)
--quickCFPROXY_QUICKForce quick tunnel mode
--setup--Interactive setup wizard for custom domains
--doctor--Run diagnostic checks
--purge--Clean stale tunnels and DNS records
--update--Update cached cloudflared binary to latest
--cloudflared-path <PATH>CFPROXY_CLOUDFLARED_PATHPath to cloudflared binary
--no-downloadCFPROXY_NO_DOWNLOADDisable automatic cloudflared download
--cache-dir <DIR>CFPROXY_CACHE_DIRCache directory for cloudflared binary
--version--Print version

Development

make build # Build release binary
make test# Run all tests
make lint # Run clippy lints
make fmt # Format code
make run PORT=3000 # Run locally
RUST_LOG=debug cargo run -- 3000 # Debug logging

License

MIT

About

Expose localhost to the internet with a full HTTP debugger in your terminal. Built on Cloudflare Tunnels.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages