How to configure embedded Tomcat integrated with Spring to listen requests to IP address, besides localhost?

后端 未结 4 812
长情又很酷
长情又很酷 2020-11-27 15:57

I am trying to run the example from the spring guide : Building a RESTful Web Service .

It works well if I open localhost:8080/greeting.

But it cann

4条回答
  •  渐次进展
    2020-11-27 16:29

    1. Try adding this to java parameters: -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false

    2. Run the query from curl: curl -vvv -X GET "http://192.168.1.111:8080/greeting"

    If the 1. doesn't help, then most likely your firewall / proxy prevent the connection. Curl should give proper indication of that

提交回复
热议问题