You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by dale77 <Da...@trimble.co.nz> on 2010/01/25 03:38:33 UTC
How to set "No Proxy For" domains?
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
--
View this message in context: http://old.nabble.com/How-to-set-%22No-Proxy-For%22-domains--tp27301481p27301481.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to set "No Proxy For" domains?
Posted by Oleg Kalnichevski <ol...@apache.org>.
dale77 wrote:
> Perhaps DefaultHttpRoutePlanner could be extended to use a NoProxyFor
> parameter?
>
> This would make things easier out-of-the-box for people. No proxy host is a
> fairly standard configuration option. I'm surprized that httpclient doesn't
> support it more easily.
>
>
You are welcome to contribute a patch.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to set "No Proxy For" domains?
Posted by dale77 <Da...@trimble.co.nz>.
Perhaps DefaultHttpRoutePlanner could be extended to use a NoProxyFor
parameter?
This would make things easier out-of-the-box for people. No proxy host is a
fairly standard configuration option. I'm surprized that httpclient doesn't
support it more easily.
--
View this message in context: http://old.nabble.com/How-to-set-%22No-Proxy-For%22-domains--tp27301481p27313443.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to set "No Proxy For" domains?
Posted by Oleg Kalnichevski <ol...@apache.org>.
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