当前位置: 首页 > 工具软件 > MX4J > 使用案例 >

mx4j.tools.adaptor.http.HttpAdaptor不能远程访问的问题

古扬
2023-12-01
使用mx4j.tools.adaptor.http.HttpAdaptor进行了JMX的HTTP Adapter。使用后发现只能在本地(localhost)上访问暴漏的服务,部署到服务器上远程访问不了。

后来查看了mx4j.tools.adaptor.http.HttpAdaptor的代码,发现该代码有个host属性,关于该属性的官方文档如此描述:

Host: Defines the host name in which the server will be listening to. By default is localhost. This means that you can't access the server from another computer. This is good for security reasons, forcing you to explicitly open the server to the outside. You can also use 0.0.0.0 which will open the server to all local interfaces
------参考地址《http://mx4j.sourceforge.net/docs/ch05.html》

原来起默认的只能本地访问呢,后来将host配置成0.0.0.0之后,问题解决
 类似资料: