title: How to use SOCKS in Java?
body: <p>I use 100% working socks and I can't connect through my application.
  <code><pre>
          SocketAddress proxyAddr = new InetSocketAddress("1.1.1.1", 12345);
          Proxy pr = new Proxy(Proxy.Type.SOCKS, proxyAddr);</p>
  
  <pre><code>    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></pre>
  
  <p></pre></code>
  So what am I doing wrong? If I'll use HTTP with some HTTP proxy all is working but not with SOCKS.</p>