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: Implementing Proxy Chaining in Apache HTTP
Date Thu, 22 Mar 2012 13:10:50 GMT
On Thu, 2012-03-22 at 02:54 -0700, diyfiesta wrote:
> Great stuff...
> 
> Something like this?
>         

Yep.

Oleg

>       DefaultHttpClient client = new DefaultHttpClient(connectionManager,
> httpParameters) {
>             @Override
>             protected RequestDirector
> createClientRequestDirector(HttpRequestExecutor requestExec,
> ClientConnectionManager conman, ConnectionReuseStrategy reustrat,
> ConnectionKeepAliveStrategy kastrat, HttpRoutePlanner rouplan, HttpProcessor
> httpProcessor, HttpRequestRetryHandler retryHandler, RedirectStrategy
> redirectStrategy, AuthenticationHandler targetAuthHandler,
> AuthenticationHandler proxyAuthHandler, UserTokenHandler stateHandler,
> HttpParams params) {
>                 return new
> DefaultRequestDirector(LogFactory.getLog(AbstractHttpClient.class),
> requestExec, conman, reustrat, kastrat, rouplan, httpProcessor,
> retryHandler, redirectStrategy, targetAuthHandler, proxyAuthHandler,
> stateHandler, params) {
>                     @Override
>                     protected boolean createTunnelToProxy(HttpRoute route,
> int hop, HttpContext context) throws HttpException, IOException {
>                         // my stuff here!
>                         return super.createTunnelToProxy(route, hop,
> context);
>                     }
>                 };
>             }
>         };
> 
> I just wanted to check because there may be a neater way to wire in my
> custom class that I didn't spot...
> 
> Thanks
> 





---------------------------------------------------------------------
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