hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Chipenko" <sume...@gmail.com>
Subject Is it possible to set ProxyHost to null?
Date Tue, 19 Feb 2008 16:17:44 GMT
Hello,

Is it possible somehow to disable using proxy in HTTPClient, if it already
has set before? Maybe assign null, which is not allowed by superclass?

Here is sample:

HttpClient client = new HttpClient();
        try {
            HostConfiguration config = client.getHostConfiguration();
            config.setProxy('proxy.myorg.net',  3128);
            client.setHostConfiguration(config);

            // do something

            config.setProxy(null,  -1);                          \\  <-----
Exception was raised in this line
            client.setHostConfiguration(config);
        } finally {
       }



resulted:
null
-1
Exception in thread "main" java.lang.IllegalArgumentException: Host name may
not be null

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message