无法访问其他设备上的本地主机

I am building a web app using Node and express. On my PC, I run the app by typing node app.js which gets the server running on http://localhost:1008/

On my android phone, which is connected to the same network, I typed
http://<ipv4 address>:1008/ but it doesn't work. The wifi network is set to private(home) and i tried turning off firewall, but still it doesn't work
I am using Windows 7 PC.
Any help is appreciated

评论
  • Giles
    Giles 回复

    您有几种可能无法访问其他设备上的节点服务器,

    1. 您可能已在计算机上安装了防病毒软件,以保护防火墙。因此,不允许访问运行应用程序服务器的端口。
    2. Windows Defender不允许您访问主机外部的端口。

    解决上述问题的方法是,

    1. 如果您具有防病毒功能,则需要允许防病毒防火墙设置中的端口
    2. 如果Windows Defender /防火墙拒绝了端口访问,则需要允许来自Windows防火墙的端口