Web
Web (Gateway)
Section titled “Web (Gateway)”Gateway 在与 Gateway WebSocket 相同的端口上提供一个小型的 浏览器 Control UI (Vite + Lit):
- 默认:
http://<host>:18789/ - 可选前缀:设置
gateway.controlUi.basePath(例如/openclaw)
功能位于 Control UI。 本页重点介绍绑定模式、安全性和面向 Web 的界面。
Webhooks
Section titled “Webhooks”当 hooks.enabled=true 时,Gateway 还在同一 HTTP 服务器上暴露一个小型的 Webhook 端点。 参见 Gateway 配置 → hooks 获取认证 + 载荷信息。
配置 (默认开启)
Section titled “配置 (默认开启)”当存在资源 (dist/control-ui) 时,Control UI 默认启用。 您可以通过配置控制它:
{ gateway: { controlUi: { enabled: true, basePath: "/openclaw" }, // basePath 可选 },}Tailscale 访问
Section titled “Tailscale 访问”集成 Serve (推荐)
Section titled “集成 Serve (推荐)”保持 Gateway 在 Loopback 上,让 Tailscale Serve 代理它:
{ gateway: { bind: "loopback", tailscale: { mode: "serve" }, },}然后启动 Gateway:
openclaw gateway打开:
https://<magicdns>/(或您配置的gateway.controlUi.basePath)
Tailnet 绑定 + Token
Section titled “Tailnet 绑定 + Token”{ gateway: { bind: "tailnet", controlUi: { enabled: true }, auth: { mode: "token", token: "your-token" }, },}然后启动 Gateway(非 Loopback 绑定需要 Token):
openclaw gateway打开:
http://<tailscale-ip>:18789/(或您配置的gateway.controlUi.basePath)
公共互联网 (Funnel)
Section titled “公共互联网 (Funnel)”{ gateway: { bind: "loopback", tailscale: { mode: "funnel" }, auth: { mode: "password" }, // 或 OPENCLAW_GATEWAY_PASSWORD },}- Gateway 认证默认是必需的(Token/密码或 Tailscale 身份头)。
- 非 Loopback 绑定仍然 需要 共享 Token/密码 (
gateway.auth或 env)。 - 向导默认生成一个 Gateway Token(即使在 Loopback 上)。
- UI 发送
connect.params.auth.token或connect.params.auth.password。 - 使用 Serve 时,当
gateway.auth.allowTailscale为true时,Tailscale 身份头可以满足认证(无需 Token/密码)。设置gateway.auth.allowTailscale: false以要求显式凭证。参见 Tailscale 和 安全性。 gateway.tailscale.mode: "funnel"需要gateway.auth.mode: "password"(共享密码)。
Gateway 从 dist/control-ui 提供静态文件。构建命令:
pnpm ui:build # 首次运行时自动安装 UI 依赖