0

我是 dart web 的新手,现在我正在尝试从同一网络上的其他设备访问我的网页。

当我输入命令 webdev serve 时,一个嵌入式网络服务器在端口 8080 上进行侦听,我可以通过该设备上的 127.0.0.1:8080 访问它。但我无法从同一网络上的其他设备访问它<DeviceLocalIP>:<port>

在过去,我尝试从其他设备访问 Wamp VirtualHost,并且以这种方式工作。请帮忙 。

4

1 回答 1

3

By default, webdev listens on 127.0.0.1 which is a special address that means 'listen on this device only'. To access your web page from another device you'll need to use the --hostname flag to specify the hostname or IP address of your computer, or you can use 0.0.0.0 to listen on all interfaces, i.e.

webdev serve --hostname 0.0.0.0
于 2019-06-21T14:29:37.753 回答