Cloud 模式零成本穿透 HTTP/WS,Relay 模式自建中继支持 TCP/UDP 全协议
基于 Cloudflare Tunnel,免费穿透 HTTP/HTTPS/WebSocket,自动 TLS,全球 CDN 加速
基于 frp 自建中继,支持 TCP/UDP 全协议穿透,适合游戏服务器、SSH、数据库等场景
cftunnel quick 3000 即刻穿透,零配置上手
macOS / Linux / Windows,ARM64 + AMD64 全覆盖
绑定自己的域名,自动配置 DNS 和 TLS 证书
一键注册 launchd / systemd / Windows Service,开机自启
自动检测平台下载对应二进制,无需手动安装
cftunnel selfupdate 一键升级到最新版本
纯 Go 实现跨平台 tail,实时查看隧道日志
MIT 协议,代码完全开源,社区驱动
--auth 一键启用密码保护,内置鉴权代理中间件
图形界面管理隧道,适合不熟悉命令行的用户
两种穿透路径,覆盖不同场景需求
根据你的场景选择合适的穿透模式
| 功能 | Cloud 模式 | Relay 模式 |
|---|---|---|
| 支持协议 | HTTP / HTTPS / WebSocket | TCP / UDP / 全协议 |
| 需要 | Cloudflare 账号(免费) | 一台公网服务器 |
| 域名 | 免费随机域名 / 自有域名 | 服务器 IP 直连 |
| 加密 | 自动 TLS + Cloudflare CDN | frp 内置加密 |
| 费用 | 完全免费 | 服务器成本 |
| 典型场景 | Web 开发、API 调试、Webhook | 游戏服务器、SSH、数据库、RDP |
| 启动命令 | cftunnel quick 3000 | cftunnel quick 25565 --relay |
两种模式的常用命令一览
遇到问题?这里有最常见的解决方案
部分网络环境屏蔽 UDP/443。解决:设置 --protocol http2 回退到 HTTP/2,或检查防火墙规则。
Clash 等代理工具的 fake-ip 模式可能劫持 Cloudflare 域名解析。解决:将 trycloudflare.com 加入直连规则。
Cloudflare Argo Tunnel 错误,通常是隧道配置不匹配。解决:cftunnel down 后重新 cftunnel up,或删除重建隧道。
DNS 解析指向了错误的隧道。解决:检查 DNS CNAME 记录是否指向正确的 tunnel UUID,使用 cftunnel remove 清理后重新添加。
选择你的平台,一行命令搞定
# 自动尝试国内镜像源加速,无需手动配置 curl -fsSL https://raw.githubusercontent.com/qingchencloud/cftunnel/main/install.sh | bash # 国内网络慢?也可以手动使用镜像源下载: # curl -fsSL https://ghfast.top/https://github.com/qingchencloud/cftunnel/releases/latest/download/cftunnel_linux_amd64.tar.gz -o cftunnel.tar.gz # tar xzf cftunnel.tar.gz && sudo install -m 755 cftunnel /usr/local/bin/
irm https://raw.githubusercontent.com/qingchencloud/cftunnel/main/install.ps1 | iex
git clone https://github.com/qingchencloud/cftunnel.git cd cftunnel go build -o cftunnel .
从零开始,3 分钟完成内网穿透
无需 Cloudflare 账号,获得随机域名,适合临时分享和调试
cftunnel quick 3000
绑定自己的域名,需要 Cloudflare 账号和 API Token
cftunnel init cftunnel create mytunnel cftunnel add myapp 8080 --domain app.example.com cftunnel up
自建中继服务器,支持 TCP/UDP 全协议穿透
cftunnel relay init cftunnel relay add mc --local 25565 --proto tcp cftunnel relay up
在你的公网服务器上部署 frps,作为中继节点
# 在本地一条命令搞定服务端安装 + 客户端配置 cftunnel relay server setup --host 你的服务器IP --user root # 支持密钥认证 cftunnel relay server setup --host 1.2.3.4 --key ~/.ssh/id_ed25519 # 支持密码认证(交互输入,不落历史记录) cftunnel relay server setup --host 1.2.3.4 --password # 全交互模式 cftunnel relay server setup
curl -fsSL https://raw.githubusercontent.com/qingchencloud/cftunnel/main/install-relay.sh | bash
# 1. 下载配置文件 mkdir -p cftunnel-relay && cd cftunnel-relay curl -fsSLO https://raw.githubusercontent.com/qingchencloud/cftunnel/main/docker/relay-server/docker-compose.yml curl -fsSLO https://raw.githubusercontent.com/qingchencloud/cftunnel/main/docker/relay-server/frps.toml.example cp frps.toml.example frps.toml # 2. 编辑 frps.toml,设置你的 auth.token # bindPort = 7000 # auth.token = "你的密钥" # 3. 启动 docker compose up -d