hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Motes <davidmo...@gmail.com>
Subject Re: Need help with ProxySelectorRoutePlanner
Date Mon, 17 Jan 2011 20:13:23 GMT
 Here is my final report, after doing some research.
The problem with using the system proxy configuration as been
discussed since 2005 with no resolution.
You cannot get the JVM sockets code to use the system
proxy config.  It either ignores it or tries to use a socks proxy
instead of the http proxy.

I used a test program which used the
System.setProperty("java.net.useSystemProxies",
"true"). It opened a socket, sent a get to a web server, read the
response, and closed the socket (not using httpclient).
I tested on XP, Vista, windows 7, and a Mac. I set the proxy config in
the Java control panel and then set it to use the browser,system proxy
settings.
The Mac ignores the setting and does not use the proxy no matter how
you configure it. The windows systems either ignore it or try to use a
socks proxy and get hung up.
The Java sockets code does not understand system proxies which is why
the HttpClient does not work when java.net.useSystemProxies is true.

If anyone says it works for them they are using java.net.URLConnection.
  URLConnection works the way it is supposed to on windows and Mac.
  Changed the test program to get a URL using URLConnection.  It used
the proxy in the system config and worked the way it should.
   So apparently URLConnection does not end up in the usual Sockets code.

Hopefully this will help someone. Don't waste your time trying to use
java.net.useSystemProxies with Sockets or HttpClient.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message