hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul_b <pblake...@gmail.com>
Subject Re: Need an example of user authentication for BOTH proxy and target???
Date Wed, 04 Jul 2012 09:38:07 GMT

Thanks for your reply.  Looking at my code, which I think there is nothing
different than the examples, I cant see how...  I have included a snippet of
my code below.  I was expecting something in the ConnRoutePNames according
to what you say but there doesnt seem to be.

		httpclient.getCredentialsProvider().setCredentials(
				new AuthScope(PROXY_URL, PROXY_PORT),
				new UsernamePasswordCredentials(credentials.getUsername(),
credentials.getPassword()));
		HttpHost proxy = new HttpHost(PROXY_URL, PROXY_PORT);
		httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
				proxy);



olegk wrote:
> 
> On Wed, 2012-07-04 at 01:29 -0700, paul_b wrote:
>> Hi,
>>   I have been looking on the internet and unable to find an example of
>> the
>> DefaultHttpClient class with the capability of using user authentication
>> for
>> both proxy and target.  I can see from the document that there are
>> examples
>> of user authentication for either proxy and target, both not both!  I can
>> see examples of older libraries with this scenario, but not the latest. 
>> I
>> would much appreciate if someone could post an example.
>> 
>> Cheers,
>>   paul
> 
> There is nothing special about it. Just make sure you provide
> credentials for both target and proxy hosts. HttpClient will do the rest
> automatically.
> 
> Oleg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Need-an-example-of-user-authentication-for-BOTH-proxy-and-target----tp34111923p34112192.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


Mime
View raw message