hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: How to set proxy information in httpClient object from browser
Date Fri, 31 Aug 2007 17:47:23 GMT
Thank you for reading the mailing list guidelines.[1] They link
to [2], which has a section "If You Can't Get An Answer"[3] that
might interest you.

nitya vyas wrote:
> Hi there,
> I am using a single HTTPClient object (static) for the desktop application
> with different method objects (get,post,multipartpost) for each call..I
> have also implemented StrictSSLSocketFactory implementation (SSL) for that
> httpClient object. Now i m suppose to get the proxy information from the
> default browser
Have a look at the proxy section of our Application Design FAQ:

I'm not sure that any of these methods will give you the proxy settings
of the default browser reliably, but you might get the operating system
settings on Windows (which are the IE settings) if you are using a 5.0
or newer JVM. If that is not sufficient, you probably have to contact
other forums to learn how to obtain the default browser settings.

> and set the proxy for all requests. I believe it must be
> done for the same static httpClient object for my app

That is correct. httpClient.getHostConfiguration().setProxy(...)
should do the trick, assuming that you don't pass an explicit
HostConfiguration when executing the methods.

hope that helps,

[1] http://jakarta.apache.org/site/mail.html
[2] http://www.catb.org/~esr/faqs/smart-questions.html
[3] http://www.catb.org/~esr/faqs/smart-questions.html#id272290

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message