Make sure your device is charged above 50 % and connected to a stable Wi‑Fi network. You will need an active internet connection to download Termux and the proxy packages. The steps below work on Android 8.0 (Oreo) and newer; older versions may have slightly different Settings menus.
Termux. Install the app.termux-setup-storage
Accept the permission prompt that appears.pkg update && pkg upgrade -ytinyproxy, a small HTTP/HTTPS proxy that runs comfortably on a phone:
pkg install tinyproxy -ytinyproxy -v
You should see a version string like tinyproxy/1.10.0.tinyproxy reads a configuration file located at $PREFIX/etc/tinyproxy/tinyproxy.conf. The default file works, but we’ll tweak a few settings for a smoother mobile experience.
nano (install it if missing with pkg install nano):
nano $PREFIX/etc/tinyproxy/tinyproxy.confPort and change the port to something unlikely to clash with other apps, e.g., 8888:
Port 8888Allow directive and limit access to the local device only:
Allow 127.0.0.1
This prevents other devices on the Wi‑Fi network from using your proxy unintentionally.LogLevel line and set it to Info:
LogLevel InfoTermux can keep processes alive after you close the app using the termux-wake-lock and nohup utilities.
termux-wake-locknohup tinyproxy -c $PREFIX/etc/tinyproxy/tinyproxy.conf > $HOME/tinyproxy.log 2>&1 &ps | grep tinyproxy
You should see an entry with the command you just launched.Before routing all traffic, test the proxy with a simple curl request.
pkg install curl -ycurl -x 127.0.0.1:8888 https://httpbin.org/ip
The JSON response should contain an origin field showing your public IP – the request has passed through the proxy.Android offers two ways to point apps to a proxy: via the UI (per‑Wi‑Fi network) or via ADB for a device‑wide setting. The UI method is simpler but only applies when you’re connected to the specific Wi‑Fi network.
127.0.0.1 as the Proxy hostname and 8888 as the Proxy port. Leave the Bypass proxy for field empty unless you need exceptions.This method writes the proxy configuration to the global settings database, affecting all Wi‑Fi connections.
adb shell settings put global http_proxy 127.0.0.1:8888adb shell settings get global http_proxy
It should echo 127.0.0.1:8888.adb shell settings delete global http_proxyOpen Chrome (or any browser) and navigate to https://www.whatismyip.com/. The site should display the same IP address you saw in the curl test, confirming that traffic is passing through tinyproxy.
If you notice that the page fails to load, double‑check the following:
ps | grep tinyproxy).tinyproxy can be extended with a simple filter file that blocks requests matching patterns. This is handy if you want a lightweight ad‑blocker without installing a full VPN‑based solution.
cat > $HOME/tinyproxy.filter <<'EOF'
# Block common ad domains
.*\.doubleclick\.net
.*\.googlesyndication\.com
.*\.adservice\.google\.com
EOFFilter $HOME/tinyproxy.filter
Save and restart tinyproxy (kill the old process and start it again with the nohup command from step 4).After restarting, requests to the listed domains will be denied with a 403 Forbidden response, effectively blocking many ads.
netstat -tulpn | grep 8888 to see the conflict.Port line in tinyproxy.conf to an unused port (e.g., 8080) and update the system proxy setting accordingly.termux-wake-lock (already enabled in step 4).127.0.0.1 means only apps on the same device can reach it. Do NOT change the Allow line to 0.0.0.0/0 unless you understand the network exposure risks.cp tinyproxy.conf tinyproxy.conf.backup) before making changes.By following these steps you now have a fully functional, local HTTP proxy running entirely in user space via Termux. You can route web traffic through it, add simple domain filters, and even use the setup as a stepping stone toward more advanced proxy or VPN configurations—all without ever rooting your device.
When you no longer need the proxy, simply stop the process (pkill tinyproxy), release the wake lock (termux-wake-unlock), and clear the global proxy setting with adb shell settings delete global http_proxy. Your Android device will return to its normal networking behavior.









