January 16th, 2013, 07:30 AM
Help: Proxy authentication and multiple proxies connection
I hope someone can put some clarification on this problem that I'm having.
I am using Apache HTTPClient 4.2 library and I use proxies to connect to internet.
For normal proxies I don't have any problem and it goes through the proxy but I'm not sure how this works when the proxy requires an authentication.
Can someone tell the implementation required to authenticate the proxy via username and pass(which I have) and then connect via proxy to the internet?
In addition, is it possible to connect to multiple proxies? for example,assume that I want to connect to one proxy and then use that proxy to connect to another which then will connect to internet, is this achievable in Java using httpclient?
Any link containing guides,tutorial are welcome too
January 17th, 2013, 05:06 AM
Re: Help: Proxy authentication and multiple proxies connection
Try this... I guess this could work...
You can also have a look at proxy authentication example in httpclient examples section.
HttpClient httpClient = new HttpClient();
HostConfiguration config = client.getHostConfiguration();
Credentials credentials = new UsernamePasswordCredentials(proxyUser, proxyPasswd);
AuthScope authScope = new AuthScope(proxyUrl, proxyPort);
What do you mean by multiple proxies? At once? As far as I know it is not possible.
You can only connect through one proxy. It could be possible that such proxy usea another proxy, but it is not your responsibility.
Last edited by AlbertGM; January 17th, 2013 at 05:09 AM.
Please, correct me. I'm just learning.... and sorry for my english :-)
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!