Skip to content

Instantly share code, notes, and snippets.

@maks
Last active August 24, 2020 06:49
Show Gist options
  • Save maks/5915923 to your computer and use it in GitHub Desktop.
Save maks/5915923 to your computer and use it in GitHub Desktop.
Http Proxy Auth on Android

Http Proxy Auth on Android

The Plan

  1. Run a local transparent proxy on the device, talking to the external network proxy that requires authentication.
  2. Use iptables on the android device to route all traffic on ports 80, 443, etc to local proxy.
  3. A android app to provide UI for setting external proxy hostname, username, password

This will be the local proxy on the android device.

Compiling

A precompiled binary ships with the example app "Transproxy3" but its ARM binary only, so need to recompile redsocks ourselves to have a x86 version.

Steps:

1. git clone https://github.com/darkk/redsocks.git
2. ## add fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to .git/config as per https://help.github.com/articles/checking-out-pull-requests-locally
3. git fetch origin
4. git checkout pr/20
5. cd jni/libevent
6. ./configure
7. cd ../../
8. export PATH=$PATH:/path/to-nadroid-ndk
9. ndk-build

Provides useful testing starting point as well as redsocks and iptables. This can be used to determine fairly quickly if there are any issues with connecting through a specific authenticated proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment