I use 100% work socks and I cannot 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); }
code> So what am I doing wrong? If I use HTTP with some HTTP proxy, everything works, but not with SOCKS.
source share