I try following without any result:
1.
Code:
System.getProperties().put("proxySet", "false");
System.getProperties().put("http.proxyHost", "");
System.getProperties().put("http.proxyPort", "");
System.getProperties().put("socksProxyHost", "");
System.getProperties().put("socksProxyPort", "");
2.
Code:
System.setProperty("java.net.useSystemProxies","false");
3.
Code:
System.setProperty("http.nonProxyHosts","localhost|kkrzyzak");
4.
Code:
System.getProperties().remove("http.proxyHost");
System.getProperties().remove("http.proxyPort");
System.getProperties().remove("socksProxyHost");
System.getProperties().remove("socksProxyPort");
5.
Code:
System.setProperty("proxySet", "false");
System.setProperty("http.proxyHost", "");
System.setProperty("http.proxyPort", "");
System.setProperty("socksProxyHost", "");
System.setProperty("socksProxyPort", "");
6.
Code:
-Dhttp.proxyHost="" -Dhttp.proxyPort="" -DsocksProxyHost="" -DsocksProxyPort=""
I was based on the information contained in article "Java Networking and Proxies" (javase/6/docs/technotes/guides/net)
I think for some reason the JRE tries to talk SOCKS protocol to a host, which is not a SOCKS proxy.
For clearly, I haven't SOCKS proxy server.
Even created a little piece of code that shows me I am using a proxy or not.
Code:
public static void listaUstawienProxy(boolean useProxy){
try {
System.setProperty("java.net.useSystemProxies",useProxy?"true":"false");
List l = ProxySelector.getDefault().select(
new URI("http://www.yahoo.com/"));
for (Iterator iter = l.iterator(); iter.hasNext(); ) {
Proxy proxy = (Proxy) iter.next();
System.out.println("proxy hostname : " + proxy.type());
InetSocketAddress addr = (InetSocketAddress)
proxy.address();
if(addr == null) {
System.out.println("No Proxy");
} else {
System.out.println("proxy hostname : " +
addr.getHostName());
System.out.println("proxy port : " +
addr.getPort());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
When i pass false the result is :
Code:
proxy hostname : DIRECT
No Proxy
When i pass true the result is:
Code:
proxy hostname : HTTP
proxy hostname : 192.168.100.1
proxy port : 3128