【发布时间】:2016-03-20 02:51:20
【问题描述】:
我在我的 Eclipse Mars 中配置了jetty-maven-plugin,我可以使用码头启动和停止目标来运行服务器。我可以使用http://localhost:8080/myapp 访问该网站,但不能使用我自己的计算机或通过 LAN 和 Wi-Fi 连接在同一网络中的其他计算机的本地 IP 地址(即http://192.168.0.5:8080/myapp)。
正如这些帖子中提到的解决方案,
how to make jetty server accessible from LAN?
Configuring Jetty to accept connections from all hosts
我将服务器主机从localhost 配置为0.0.0.0 以监听所有主机。使用此设置,我可以在服务器启动日志中看到,
INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
它仅适用于http://localhost:8080,但无法从http://192.168.0.5:8080 访问。
我还尝试运行,如果使用Networks Interface Listing 中提到的Networks Interface Listing 可以访问该接口,我得到了,
Display name: NETGEAR WNA1000M N150 Wireless USB Micro Adapter
Name: wlan4
InetAddress: /192.168.0.5
我还尝试关闭我的 Windows 防火墙/防病毒软件,但没有帮助。我的码头版本是 <jetty.version>9.3.0.M1</jetty.version> 和 JDK 1.7。可能是什么问题呢?任何帮助表示赞赏。
【问题讨论】:
标签: eclipse networking maven-jetty-plugin jetty-9