hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <oleg.kalnichev...@bearingpoint.com>
Subject Re: getting through a proxy server
Date Fri, 08 Oct 2004 15:03:04 GMT

Madeleine,

If you activate wire/context logging in your application you'll get more
details on what exactly goes wrong

http://jakarta.apache.org/commons/httpclient/logging.html

If you need help reading the log, feel free to post it to this list. Do
obfuscate security sensitive bits such as logon credentials prior to
posting.

Oleg  


On Fri, 2004-10-08 at 16:45, Madeleine Wright wrote:
> Please can someone suggest the simplest way to access a URL 
> programatically through a proxy server?  I'm using HttpClient and the 
> proxy bits of my code look like this (everything else works fine - I can 
> access all sites inside the firewall):
> 
> HttpClient client = new HttpClient();
> .................
> client.getHostConfiguration().setProxy(proxyHost, proxyPort);
> Credentials creds = new UsernamePasswordCredentials(userName, password);
> client.getState().setProxyCredentials(realm, proxyHost, defaultcreds);
> .......................
> GetMethod method = new GetMethod(url);
> 
> I realize I seem to be supplying proxy host details twice!  But I can't 
> otherwise see how to set the proxy port?  I keep getting an "access 
> denied" message from the proxy server, indicating that I have not 
> authenticated myself.  Does anyone know how I do that other than the 
> method above (I am sure the actual proxy details given are correct).
> 
> Thanks.
> 
> Mad
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

***************************************************************************************************
The information in this email is confidential and may be legally privileged.  Access to this
email by anyone other than the intended addressee is unauthorized.  If you are not the intended
recipient of this message, any review, disclosure, copying, distribution, retention, or any
action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. 
If you are not the intended recipient, please reply to or forward a copy of this message to
the sender and delete the message, any attachments, and any copies thereof from your system.
***************************************************************************************************

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


Mime
View raw message