我正在port 8088
上的树莓派(rpi)上运行服务器。
服务器为rust / actix,我用cargo run
运行它。
我用ssh pi@raspberrypi.local
进入rpi,然后运行curl localhost:8088
。服务器返回200 OK和一个index.html文件。符合预期。
我使用hostname -I
来找到rpi 192.168.0.25
的IP地址以及这个172.17.0.1
。
当我转到同一局域网中的另一台设备并运行curl 192.168.0.25:8088
或curl raspberrypi.local:8088
时,我会得到 ERR_CONNECTION_REFUSED
如果我运行curl 172.17.0.1:8088
,则会得到 ERR_CONNECTION_TIMED_OUT
如何从本地网络上的另一台计算机访问树莓派上运行的服务器?
答案 0 :(得分:0)
感谢评论中的答案,我注意到我已将ip绑定到localhost
。
通过将其绑定到0.0.0.0
,问题已解决,我可以从外部访问服务器