Bobbey Posted January 18, 2019 Share Posted January 18, 2019 (edited) I am trying to use Socks5 proxies to make http post requests. The provider for the proxies has disabled http or something. I get the following error; Exception in thread "main" java.net.SocketException: SOCKS: Connection not allowed by ruleset I am using the code System.setProperty("java.net.socks.username", user); System.setProperty("java.net.socks.password", pass); Proxy prox = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(ip, 8000)); URL url = new URL("https://www.myip.com"); URLConnection con = url.openConnection(prox); con.setConnectTimeout(10000); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String line; while ((line = in.readLine()) != null) { System.out.println(line); } in.close(); How do I tunnel(?) this http request through the proxy? PS I know this is possible because some extension in firefox allows me to use the proxy too I have also tried this code, but it results in the same error : https://pastebin.com/xt6evbm7 Solution: System properties are not used for this, need to use Authentication.java Edited January 18, 2019 by Bobbey Quote Link to comment Share on other sites More sharing options...