小龙虾openclaw安装配置之局域网访问web页面18789
设置教程,解决:
origin not allowed
control ui requires device identity
pairing required
(open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)
(use HTTPS or localhost secure context)
openclaw默认的防护级别很严格,web只允许本机访问,如果安装在linux、工控机、开发板上,其它设备默认无法访问
想要局域网访问你在虚拟机或者其它硬件上安装的小龙虾,推荐办法
步骤:
-
openclaw机器防火墙开放18789端口
-
openclaw gateway绑定0.0.0.0而不是127.0.0.1
openclash config set gateway.bind lan
# 再重启gateway
- 这时候能通过openclaw机器IP访问,但是登录页面报错无法登录。可以让访问端将自身的端口转发到openclaw机器18789端口,以Windows为例,以管理员身份打开终端,运行
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=18789 connectaddress=小龙虾IP connectport=18789
# 后续查看与删除
# netsh interface portproxy show all
# netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=18789
这样一步是为了解决origin跨域问题 + 只允许HTTPS or localhost访问问题,端口转发后,Windows访问127.0.0.1:18789就相当于访问小龙虾了
-
浏览器访问127.0.0.1:18789,打开小龙虾页面,填入openclaw gateway token,这个token配置文件中有,或者运行openclash gateway dashboard也能出来
-
这时候web会报错pairing required,需要在openclaw上批准这个浏览器访问,运行
openclaw devices list
openclaw devices approve 请求id
浏览器再刷新就能登录

浙公网安备 33010602011771号