Tomcat and proxy settings

前端 未结 6 1365
北海茫月
北海茫月 2021-01-04 10:40

There is a servlet running on tomcat7 and it makes a webservice call to a third party website. The call works fine from the windows machine but when run from tomcat it fails

6条回答
  •  一整个雨季
    2021-01-04 11:22

    No, Tomcat won't automatically use the system proxy settings.

    I suggest you look into the facilities provided by java.net.Proxy. This allows you to dynamically specifiy a proxy at runtime. The system properties work but they are only read once, and if Tomcat has already used an HttpURLConnection for its own purposes prior to you setting them that's the end of that: the setting has no effect.

提交回复
热议问题