I am looking for a SOCKS proxy server I can run on my Android phone. I could only find some commercial apps, but would prefer a FOSS alternative.

It does not need to be an app: a binary I can run from adb shell would work as well, but I'd prefer it if it does not require root.

  • What about using ssh and it's -D option? ssh -D 8888 user@phone-ip on your PC, then use as proxy server. Tested on iOS but should work on Android aswell. (An SSH server must be installed on the phone, of course. (A FOSS one is on F-Droid)) – confetti Feb 20 '20 at 17:01
  • My phone does not currently have a SSHD. I found SimpleSSHD, but it does not support SOCKS: f-droid.org/en/packages/org.galexander.sshd – NanoBabo Feb 20 '20 at 17:15
  • Argh, SimpleSSHD is what I was referring to. I'm not aware of another FOSS SSH server for android (that also supports -D). – confetti Feb 20 '20 at 17:21
  • Ohh, so you're saying that SimpleSSHD includes a SOCKS proxy server? I did not try, just read that it didn't... Giving it a try now! – NanoBabo Feb 20 '20 at 17:31
  • 1
    @IrfanLatif I circumvent this by using a VPN service, port forwarding is done via the VPN (to a non-standard port for security reasons, specified on ssh using -p <port>. – confetti Feb 20 '20 at 19:25

Use SSH!

You can use the FOSS application SimpleSSHD for this! You can get it directly from that link or using the F-droid app store on your phone.

Once setup you can connect to your device using either your LAN or WAN IP from your PC like this:

ssh -D 8899 <PHONE-IP>

The -D option sets up a local "dynamic" application-level port forwarding, which essentially makes ssh act like a SOCKS5 (SOCKS4 is supported aswell) proxy server.

After this, you can set your proxy to on your PC. I've tested it with curl:

curl --socks5 https://myip.is

And it worked! Note that I did not even need root for this, it worked as the normal android user.

Note that if you want to use your mobile network for this your cell provider might not let you connect to SSHD using the WAN IP. A VPN can cirucmvent this if neccessary.

  • It performs poor with parallel TCP connections. And doesn't support UDP associate, right? So not useful with games, VoIP etc. Btw Termux does have sshd. A more clean CLI solution. – Irfan Latif Feb 20 '20 at 18:47
  • 1
    @IrfanLatif I'm not sure about the underlying techs of it, I used this solution before for rather low-bandwidth applications, but VoIP (with webcam) worked flawlessly. – confetti Feb 20 '20 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.