brsanthu / proxy-vole

Automatically exported from code.google.com/p/proxy-vole

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apache Httpclient 4 - not reading proxy settings from proxy-vole

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Configure a working proxy with proxy-vole
2. Access an url behind a proxy with sucess
3. Create a httpclient client and read the same url

What is the expected output? What do you see instead?
httpclient does not see proxy-vole settings reflected

What version of the product are you using? On what operating system?
latest on windows and linux

Please provide any additional information below.


Original issue reported on code.google.com by pgh.nu...@gmail.com on 29 Jan 2015 at 9:12

Hi,
Proxy vole does only work with the standard Java network stack and http client 
out of the box.
For the Apache hhtpclient you need to use a different approach like this:

ProxySearch proxySearch = ProxySearch.getDefaultProxySearch();
ProxySelector myProxySelector = proxySearch.getProxySelector();

SystemDefaultRoutePlanner routePlanner = new SystemDefaultRoutePlanner(
        myProxySelector);
CloseableHttpClient httpclient = HttpClients.custom()
        .setRoutePlanner(routePlanner)
        .build();

See also 
http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e475

Have fun,
- Rossi

Original comment by rosstaus...@googlemail.com on 9 Feb 2015 at 8:45

  • Changed state: Done
  • Added labels: Priority-Low, Type-Other
  • Removed labels: Priority-Medium, Type-Defect
Great! Thank you Rossi.

Pedro Nunes

Original comment by pgh.nu...@gmail.com on 21 Feb 2015 at 10:56