I use 100% working socks and I can't connect through my application.
SocketAddress proxyAddr = new InetSocketAddress("1.1.1.1", 12345);
Proxy pr = new Proxy(Proxy.Type.SOCKS, proxyAddr);
try
{
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(pr);
con.setConnectTimeout(proxyTimeout * 1000);
con.setReadTimeout(proxyTimeout * 1000);
con.connect();
System.out.println(con.usingProxy());
}
catch(IOException ex)
{
Logger.getLogger(Enter.class.getName()).log(Level.SEVERE, null, ex);
}
So what am I doing wrong? If I'll use HTTP with some HTTP proxy all is working but not with SOCKS.