frp-tunnel
Share local development servers via self-hosted frp tunnel with custom domains and auto HTTPS. Use when you need to share localhost with others, demo to clients, or test on mobile. Replaces ngrok/localhost.run with a stable, unlimited, self-hosted solution.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/darwin7381/frp-tunnelfrp-tunnel — 自建內網穿透
用自建的 frp + Caddy + Hetzner VPS 分享本地開發中的網站。自訂域名、自動 HTTPS、無限 tunnel。
替代方案(無 VPS 時):見
old-share-local-siteskill(ngrok/localhost.run)
⚙️ Config(自訂區塊)
使用此 skill 前,請將以下值替換成你自己的環境:
| 變數 | 目前的值 | 說明 |
|---|---|---|
| VPS IP | 5.223.75.160 | 你的 VPS 公網 IP |
| 域名 | *.tunnel.fud.city | 你的 wildcard 子域名 |
| DNS Provider | Cloudflare (fud.city) | 管理你域名 DNS 的服務 |
| GitHub 備份 | https://github.com/darwin7381/frp-tunnel | 你的 private repo(可選) |
Dashboard 密碼:不記在這裡。在 VPS 的
frps.toml裡設定你自己的密碼。
基礎資訊
| 項目 | 值 |
|---|---|
| VPS IP | 5.223.75.160 |
| VPS Provider | Hetzner Cloud, Singapore, CPX12 |
| 域名 | *.tunnel.fud.city |
| DNS | Cloudflare (fud.city) |
| HTTPS 方式 | Wildcard cert (DNS-01 challenge via Cloudflare API) |
| frp Dashboard | http://5.223.75.160:7500 |
| GitHub 備份 | https://github.com/darwin7381/frp-tunnel (private) |
| 本地 config | ~/.frp/frpc.toml |
| 本地 tmux session | frpc |
| VPS services | frps (systemd) + caddy (systemd) |
目前的 Tunnels
| 名稱 | 本地 Port | URL |
|---|---|---|
| news-dashboard | 5173 | https://news.tunnel.fud.city |
| oldweb | 8080 | https://oldweb.tunnel.fud.city |
| api | 8000 | https://api.tunnel.fud.city |
| fin-terminal | 5177 | https://terminal.tunnel.fud.city |
| fin-terminal-api | 3002 | https://terminal-api.tunnel.fud.city |
HTTPS 方式:Wildcard vs Per-Domain
VPS 上的 Caddy 有兩種方式為 tunnel 提供 HTTPS。目前使用 Wildcard(推薦)。
方式 A:Wildcard Certificate(目前使用 ✅)
原理:一張 *.tunnel.fud.city wildcard cert 涵蓋所有子域名。使用 DNS-01 challenge — Caddy 透過 Cloudflare API 自動加 TXT record 驗證。
Caddyfile:
*.tunnel.fud.city {
tls {
dns cloudflare {env.CF_API_TOKEN}
}
reverse_proxy localhost:8080
}
需要:
- Caddy with Cloudflare DNS plugin(標準版沒有,需重新編譯或下載)
- Cloudflare API Token(Zone:DNS:Edit 權限,只限 fud.city)
- Token 設定在
/etc/systemd/system/caddy.service.d/override.conf
新增 tunnel 只需改本地 frpc.toml,不用動 VPS。
安裝步驟(已完成,僅供紀錄):
# 1. 下載帶 cloudflare plugin 的 Caddy
curl -s "https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fcaddy-dns%2Fcloudflare" -o /usr/bin/caddy
chmod +x /usr/bin/caddy
# 2. 驗證 module 存在
caddy list-modules | grep cloudflare
# 3. 設定 CF token
mkdir -p /etc/systemd/system/caddy.service.d
cat > /etc/systemd/system/caddy.service.d/override.conf << EOF
[Service]
Environment="CF_API_TOKEN=你的token"
EOF
# 4. 更新 Caddyfile
cat > /etc/caddy/Caddyfile << EOF
*.tunnel.fud.city {
tls {
dns cloudflare {env.CF_API_TOKEN}
}
reverse_proxy localhost:8080
}
EOF
# 5. 重啟
systemctl daemon-reload
systemctl restart caddy
方式 B:Per-Domain Certificate(備用)
原理:每個子域名獨立簽一張 cert。使用 HTTP-01 challenge — Let's Encrypt 訪問 http://xxx/.well-known/acme-challenge/ 驗證。
Caddyfile:
news.tunnel.fud.city {
reverse_proxy localhost:8080
}
terminal.tunnel.fud.city {
reverse_proxy localhost:8080
}
# 每加一個 tunnel 就加一段
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-darwin7381-frp-tunnel": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
openclaw-tmux-persistent-process
Run programs that survive OpenClaw exec session cleanup and gateway restarts via tmux. Use when you need long-running servers, dev servers, tunnels (ngrok/cloudflared), coding agents, or any process that must outlive the current exec session. Solves: exec background processes getting SIGKILL on session cleanup. Recommended for all OpenClaw users running any long-lived process.
share-local-site
Share a local development server with anyone via a public URL. Use when you need to demo a site to a client, let a colleague preview your work, test on mobile, or share localhost over the internet. Supports ngrok (recommended), localhost.run (zero-install), and cloudflared. Handles common issues like Vue CLI Invalid Host Header automatically.