[guardian-dev] supporting SOCKS on Android via a custom SocketFactory

Nathan of Guardian nathan at guardianproject.info
Thu Sep 22 16:10:07 EDT 2016


On Thu, Sep 22, 2016, at 03:52 PM, Hans-Christoph Steiner wrote:
> I didn't find a solid reference yet, but this test for me confirms that
> at least in terms of HttpURLConnection on android-22, SOCKS proxies do
> not work:
> 
>  URL url = new URL("https://facebookcorewwwi.onion");
>  Proxy proxy = new Proxy(Proxy.Type.SOCKS,
>    new InetSocketAddress("127.0.0.1", 9050));
>  HttpURLConnection connection = (HttpURLConnection)
> url.openConnection(proxy);
>  connection.setConnectTimeout(0); // blocking connect with TCP timeout
>  connection.setReadTimeout(20000);
>  connection.getContent();
>  assertEquals(200, connection.getResponseCode());

Did you try with a non .onion address? There might be some funny name
resolution stuff happening before the network connection is attempted.

-- 
  Nathan of Guardian
  nathan at guardianproject.info


More information about the guardian-dev mailing list