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]



Reply via email to