Jetty 远程调试侦听 0.0.0.0?

Jetty remote debug listens on 0.0.0.0?

我正在尝试远程调试 Web 应用程序。按照此码头 document 上的说明进行操作。我得到了这样的 java 过程。

jetty     9682  0.4  2.2 4433620 87568 ?       Sl   15:52   0:03 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/bin/java -Xdebug -agentlib:jdwp=transport=dt_socket,address=12000,server=y,suspend=n -Djava.io.tmpdir=/tmp -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty

但是进程只监听 0.0.0.0.

这是netstat -an

的输出
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:12000               0.0.0.0:*                   LISTEN 

所以我无法在其他 IP 上连接此端口。

我的问题是这是怎么发生的以及如何解决?

编辑:我错了。我对 netstat 的输出感到困惑。因为8080端口的输出是

tcp        0      0 :::8080                     :::*                        LISTEN 

我终于意识到这可能是由防火墙引起的。我通过将此端口添加到 iptables 解决了这个问题。

0.0.0.0 means "all IPv4 addresses on the local machine". If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.

发件人:https://en.wikipedia.org/wiki/0.0.0.0

更多信息请访问 Is binding to 0.0.0.0 in Java guaranteed to bind to all network interfaces?