Skip to content

Tunnel Configuration CN

Jazzen Chen edited this page May 24, 2026 · 6 revisions

Tunnel 配置

Tunnel 用于把本地 Web Chat、Web Terminal、Preview URL 暴露到公网。它是可选功能。

Providers

Provider 适用场景
None 只在本机使用
Cloudflare Tunnel 通过 Cloudflare 获得较稳定的公网访问
ngrok 使用 ngrok account/token 快速生成公网 URL
localtunnel 临时轻量公网 URL

本地访问

不开 tunnel 时使用:

http://127.0.0.1:12358/va/

Loopback host 默认信任,不需要 pairing。

公网 URL 安全

公网 tunnel host 需要浏览器 pairing。Pairing 保护 Web Chat、Web Terminal、API routes 和 Preview links。

见 认证与访问控制。

Preview URLs

Agent 可以为这些内容创建 preview:

  • dev server
  • 渲染后的 Markdown
  • HTML file

Preview URL 短时有效,并绑定 preview session。如果开启 tunnel,public preview URL 会使用 tunnel host。

故障排除

现象 检查
公网 URL 打不开 Tunnel process、provider token/config、防火墙
浏览器反复要求 pairing Cookie 被阻止、浏览器 profile 不同、本地 auth 过期
本地 preview 正常但公网不行 Tunnel route、preview target 是否还在运行、auth pairing
ngrok/localtunnel 不稳定 长时间使用建议换 Cloudflare Tunnel

Clone this wiki locally