Web (Gateway)
Gateway cung cấp một Control UI trên trình duyệt nhỏ gọn (Vite + Lit) từ cùng port với Gateway WebSocket:
- mặc định:
http://<host>:18789/ - prefix tùy chọn: đặt
gateway.controlUi.basePath(ví dụ/openclaw)
Các tính năng chi tiết nằm trong Control UI. Trang này tập trung vào các chế độ bind, bảo mật và giao diện web.
Webhooks
Khi hooks.enabled=true, Gateway cũng cung cấp một webhook endpoint nhỏ trên cùng HTTP server.
Xem Cấu hình Gateway → hooks để biết về auth và payloads.
Config (mặc định bật)
Control UI được bật mặc định khi có assets (dist/control-ui).
Các bạn có thể điều khiển nó qua config:
{
gateway: {
controlUi: { enabled: true, basePath: "/openclaw" }, // basePath tùy chọn
},
}
Truy cập qua Tailscale
Integrated Serve (khuyên dùng)
Giữ Gateway ở chế độ loopback và để Tailscale Serve proxy nó:
{
gateway: {
bind: "loopback",
tailscale: { mode: "serve" },
},
}
Sau đó khởi động gateway:
openclaw gateway
Mở:
https://<magicdns>/(hoặcgateway.controlUi.basePathmà các bạn đã config)
Tailnet bind + token
{
gateway: {
bind: "tailnet",
controlUi: { enabled: true },
auth: { mode: "token", token: "your-token" },
},
}
Sau đó khởi động gateway (cần token cho các bind không phải loopback):
openclaw gateway
Mở:
http://<tailscale-ip>:18789/(hoặcgateway.controlUi.basePathmà các bạn đã config)
Public internet (Funnel)
{
gateway: {
bind: "loopback",
tailscale: { mode: "funnel" },
auth: { mode: "password" }, // hoặc OPENCLAW_GATEWAY_PASSWORD
},
}
Lưu ý về bảo mật
- Gateway auth được yêu cầu mặc định (token/password hoặc Tailscale identity headers).
- Các bind không phải loopback vẫn yêu cầu một token/password chung (
gateway.authhoặc env). - Wizard tạo gateway token mặc định (ngay cả trên loopback).
- UI gửi
connect.params.auth.tokenhoặcconnect.params.auth.password. - Với Serve, Tailscale identity headers có thể thỏa mãn auth khi
gateway.auth.allowTailscalelàtrue(không cần token/password). Đặtgateway.auth.allowTailscale: falseđể yêu cầu credentials rõ ràng. Xem Tailscale và Security. gateway.tailscale.mode: "funnel"yêu cầugateway.auth.mode: "password"(shared password).
Build UI
Gateway phục vụ các file tĩnh từ dist/control-ui. Build chúng bằng:
pnpm ui:build # tự động cài đặt UI deps ở lần chạy đầu tiên