coolicer
V2EX  ›  Node.js

为什么我只监听端口,局域网的机器无法访问我的Express服务器

  •  
  •   coolicer · Oct 12, 2013 · 6280 views
    This topic created in 4793 days ago, the information mentioned may be changed or developed.
    只有一个app.listen(3000),防火墙什么的都没有。
    6 replies  •  1970-01-01 08:00:00 +08:00
    Livid
    Livid
    MOD
    PRO
    Oct 12, 2013
    1
    如果试试 app.listen(3000, '0.0.0.0') 呢?
    coolicer
    coolicer
    OP
    Oct 12, 2013
    2
    @Livid 试过了,它没有监听IP应该跟0.0.0.0的效果一样吧。我不知道哪里出错,慢慢找。
    jasontse
    jasontse
    Oct 12, 2013 via iPad
    3
    netstat -ln
    leofml
    leofml
    Oct 12, 2013
    4
    试试 python -m SimpleHTTPServer 3000 能不能用
    coolicer
    coolicer
    OP
    Oct 12, 2013
    5
    不好意思,我懂了。我是虚拟机里的服务器...
    @leofml
    timothyye
    timothyye
    Oct 31, 2013
    6
    @coolicer 把虚拟机的网卡设成桥接模式,分配到一个局域网里的IP,就行了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   903 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:24 · PVG 05:24 · LAX 13:24 · JFK 16:24
    ♥ Do have faith in what you're doing.