hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How to set "No Proxy For" domains?
Date Mon, 25 Jan 2010 09:19:53 GMT
On Sun, 2010-01-24 at 18:38 -0800, dale77 wrote:
> Hello,
> 
> I have a situation where I want to avoid the proxy for the local intranet.
> How do I do this with httpclient 4?
> 
> Currently I'm using code like this:
> 
> proxyClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);	
> HttpGet httpget = new HttpGet(uri);	
> ResponseHandler<String> responseHandler = new BasicResponseHandler();
> String responseBody = proxyClient.execute(httpget, responseHandler);
> 
> Thanks
> 
> Dale
> 

Dale,

You should provide a custom implementation of the HttpRoutePlanner
interface

http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html#d4e454
http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/http/conn/routing/HttpRoutePlanner.html

Oleg


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


Mime
View raw message