Proxy settings in a java program

前端 未结 9 672
[愿得一人]
[愿得一人] 2020-12-14 12:09

I am trying to connect to a web service with a client generated from wsdl through a java program in eclipse. I am passing my request through a proxy server. But it seems tha

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 12:34

    I use the following code (and it works):

        String host = "10.x.x.x";
        String port = "80";
        System.out.println("Using proxy: " + host + ":" + port);
        System.setProperty("http.proxyHost", host);
        System.setProperty("http.proxyPort", port);
        System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
    

提交回复
热议问题