title: android SOCKS proxy
body: <p>I have the following code in my (test) android project:</p>
  
  <pre><code>        URL u = new URL("http://www.google.com");
  
          InetSocketAddress sa = InetSocketAddress.createUnresolved("127.0.0.1", 1080);
          Proxy proxy = new Proxy(Proxy.Type.SOCKS, sa);
          HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy);
  </code></pre>
  
  <p>Then I have implemented a SOCKS server listening on port 1080.</p>
  
  <p>The problem I have is that in the SOCKS4 connection request, the destination address and port is not "ip for google":80 but rather 127.0.0.1:1080, i.e. the proxy address.</p>
  
  <p>If I return ok, I start getting HTTP data. </p>
  
  <p>Am I doing something wrong or is there a bug in the SOCKS-client?</p>