内网共享 OpenClaw 访问指南
默认情况下,OpenClaw Gateway 只监听本机回环地址(127.0.0.1),局域网内的其他设备无法直接访问。本文档说明如何配置,使同一网络内的其他设备能够连接使用。
背景
默认情况下,OpenClaw Gateway 只监听本机回环地址(127.0.0.1),局域网内的其他设备无法直接访问。本文档说明如何配置,使同一网络内的其他设备能够连接使用。
可解决的问题即过程中遇到的错误
1. 局域网直接输入内网openclaw的电脑的ip地址,发现打不开
origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)
2. 局域网内共享,说也需要https,会提示如下内容
control ui requires device identity (use HTTPS or localhost secure context)
3. 终于能配置了,发现又提示:
pairing required
4. 授权成功了,还是打不开
剩下的缺点
OpenClaw Browser Relay无法使用了,因为它不支持https
错误修复或者配置办法
步骤 1:修改网关绑定模式为局域网
手动编辑 `~/.openclaw/openclaw.json`,加粗的地方为修改内容:
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowedOrigins": [
"https://内网ip地址:18789",
"http://localhost:18789",
"http://127.0.0.1:18789"
]
},
"tls": {
"enabled": true,
"autoGenerate": true,
"allowHttp": true
}
},
```
步骤 2:允许内网设备访问控制面板
- openclaw devices list
此命令查询需要paired的设备(已配对和未配对的)
- openclaw devices approve Deviceid
此命令是授权未配对的设备
步骤 3:重启网关使配置生效
```bash
openclaw gateway restart
最后请使用:
https://内网ip地址:18789,输入秘钥后打开。
更多推荐

所有评论(0)