Madeleine,

Stupid question but is your proxy server using NTLM authentication? 

I had to do some hoop jumping to get NTLM to work properly, but it's working
now if you need some
code.

Erik

-----Original Message-----
From: Madeleine Wright [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 08, 2004 8:46 AM
To: Commons HttpClient Project
Subject: getting through a proxy server


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:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to