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 Benjamin Pasero <be...@web.de> on 2005/04/13 00:13:29 UTC
Having problems with Proxy Connections
Hi,
I am wondering why some of my users fail to use a proxy server. I am
running my application with HttpClient 3.0 RC1.
In order to make the connection ready for proxy, I am:
1.) Calling HttpClient#getParams().setAuthenticationPreemptive(true);
2.) Calling HttpClient#getHostConfiguration().setProxy(proxyHost,
proxyPort);
with the Proxy Host and Proxy Port entered by the user.
3.) Then in case a username and password is supplied (and ONLY then)
calling:
AuthScope proxyAuthScope = new AuthScope(proxyHost, proxyPort);
UsernamePasswordCredentials proxyUserPasswd = new
UsernamePasswordCredentials(proxyUsername, proxyPassword);
HttpClient#getState().setProxyCredentials(proxyAuthScope,
proxyUserPasswd);
That is it, or am I missing something here? Should I maybe use
NTCredentials just in case
the Proxy uses NTLM Authentification. Any other Tips?
Regards,
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org