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 Tarun Ramakrishna <le...@gmail.com> on 2005/03/18 17:28:48 UTC

Differing Proxy Configurations with single instance of HttpClient

Hi all,

I want to use a single instance of HttpClient with the
MultiThreadedHttpConnectionManager for retrieving files from several
URL's simultaneously. Now I need to ensure that some of these
connections are made through a proxy server whereas others are made
directly. (I pick these rules from the windows registry settings)

>From the API I haven't found a direct way to do this. HttpClient takes
a single instance of HostConfiguration using setHostConfiguration when
I had expected it to possess an addHostConfiguration() method.

>From the looks of things I need to provide my own
HttpConnectionManager and delegate to
MultiThreadedHttpConnectionManager in order to achieve this - but I
just wanted to confirm whether this would be the right way to go about
doing it.

All help appreciated. And thanks for making such a great library! :-)

Regards,
Tarun

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


Re: Differing Proxy Configurations with single instance of HttpClient

Posted by Tarun Ramakrishna <le...@gmail.com>.
Hi Oleg,

So sorry! I am afraid I missed that method when it was right in front
of my eyes...

Thanks,
Tarun




On Fri, 18 Mar 2005 17:35:10 +0100, Oleg Kalnichevski <ol...@apache.org> wrote:
> Tarun
> 
> The default host configuration can be overridden by passing a custom
> host config to HttpClient#executeMethod as a parameter. For details see
> <http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpClient.html#executeMethod(org.apache.commons.httpclient.HostConfiguration,%20org.apache.commons.httpclient.HttpMethod,%20org.apache.commons.httpclient.HttpState)>
> 
> Hope this helps
> 
> Oleg
> 
> 
> On Fri, Mar 18, 2005 at 09:58:48PM +0530, Tarun Ramakrishna wrote:
> > Hi all,
> >
> > I want to use a single instance of HttpClient with the
> > MultiThreadedHttpConnectionManager for retrieving files from several
> > URL's simultaneously. Now I need to ensure that some of these
> > connections are made through a proxy server whereas others are made
> > directly. (I pick these rules from the windows registry settings)
> >
> > From the API I haven't found a direct way to do this. HttpClient takes
> > a single instance of HostConfiguration using setHostConfiguration when
> > I had expected it to possess an addHostConfiguration() method.
> >
> > From the looks of things I need to provide my own
> > HttpConnectionManager and delegate to
> > MultiThreadedHttpConnectionManager in order to achieve this - but I
> > just wanted to confirm whether this would be the right way to go about
> > doing it.
> >
> > All help appreciated. And thanks for making such a great library! :-)
> >
> > Regards,
> > Tarun
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
>

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


Re: Differing Proxy Configurations with single instance of HttpClient

Posted by Oleg Kalnichevski <ol...@apache.org>.
Tarun

The default host configuration can be overridden by passing a custom
host config to HttpClient#executeMethod as a parameter. For details see
<http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpClient.html#executeMethod(org.apache.commons.httpclient.HostConfiguration,%20org.apache.commons.httpclient.HttpMethod,%20org.apache.commons.httpclient.HttpState)>

Hope this helps

Oleg


On Fri, Mar 18, 2005 at 09:58:48PM +0530, Tarun Ramakrishna wrote:
> Hi all,
> 
> I want to use a single instance of HttpClient with the
> MultiThreadedHttpConnectionManager for retrieving files from several
> URL's simultaneously. Now I need to ensure that some of these
> connections are made through a proxy server whereas others are made
> directly. (I pick these rules from the windows registry settings)
> 
> From the API I haven't found a direct way to do this. HttpClient takes
> a single instance of HostConfiguration using setHostConfiguration when
> I had expected it to possess an addHostConfiguration() method.
> 
> From the looks of things I need to provide my own
> HttpConnectionManager and delegate to
> MultiThreadedHttpConnectionManager in order to achieve this - but I
> just wanted to confirm whether this would be the right way to go about
> doing it.
> 
> All help appreciated. And thanks for making such a great library! :-)
> 
> Regards,
> Tarun
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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