How to Configure a System‑Wide Proxy Auto‑Config (PAC) File on Android (No Root)

8 min read Learn how to set up a system‑wide Proxy Auto‑Config (PAC) file on Android without rooting. Step‑by‑step guide, verification tips and troubleshooting included. October 10, 2026 14:30 How to Configure a System‑Wide Proxy Auto‑Config (PAC) File on Android (No Root)

Before you start

Configuring a Proxy Auto‑Config (PAC) file lets you define flexible proxy rules—such as directing only certain domains through a proxy while letting the rest go direct. Android supports PAC files for Wi‑Fi networks, but the feature is hidden in the Advanced proxy settings. The steps below work on Android 9 (Pie) and newer; older versions may lack the Auto proxy option.

  • Wi‑Fi connection: The PAC file can only be applied to a specific Wi‑Fi network. Cellular data requires a VPN‑based solution, which is outside the scope of this guide.
  • Trusted proxy: Using an untrusted proxy can expose your traffic. Only use a proxy you control or a reputable service.
  • Backup: Changing network settings is safe, but if you plan to modify the PAC file later, keep a copy of the original file.
  • Internet access: You need a working Wi‑Fi connection to download the PAC file or host it locally.

Step‑by‑step setup

1. Create the PAC file

A PAC file is a plain‑text JavaScript file that returns a proxy string based on the URL being requested. Below is a minimal example that sends all traffic to a proxy at proxy.example.com:8080, except requests to *.example.org, which go direct.

function FindProxyForURL(url, host) {
    // Bypass the proxy for internal sites
    if (dnsDomainIs(host, ".example.org")) {
        return "DIRECT";
    }
    // All other traffic goes through the proxy
    return "PROXY proxy.example.com:8080";
}

Save this text as myproxy.pac. If you need more complex rules, consult the PAC specification, but keep the file under 10 KB for reliable Android parsing.

2. Host the PAC file where Android can reach it

You have three practical options:

  1. Online host: Upload the file to a static‑file service (e.g., GitHub Gist, Dropbox public folder). Make sure the URL ends with .pac and is served with Content-Type: application/x-ns-proxy-autoconfig or text/plain.
  2. Local web server: Use Termux to run a lightweight server.
    pkg install python
    python -m http.server 8000 --bind 127.0.0.1
    Place myproxy.pac in the directory where you start the server. The URL will be http://127.0.0.1:8000/myproxy.pac. Note that Android can only access the loopback address from the same app, so for a truly local host you need to use the device’s Wi‑Fi IP (e.g., http://192.168.1.42:8000/myproxy.pac).
  3. Network share: If you have a local web server or NAS, place the file there and note its URL.

For most users the online host is simplest; just copy the raw file URL.

3. Connect to the Wi‑Fi network you want to configure

Open Settings → Network & internet → Wi‑Fi. Tap the gear icon next to the target network (or long‑press and choose Modify network).

In the network edit screen, expand Advanced options. Under Proxy you will see three choices: None, Manual, and Auto. Select Auto.

4. Enter the PAC file URL

When Auto is selected, a field labelled Proxy Auto‑Config URL appears. Paste the full URL of your PAC file (e.g., https://gist.githubusercontent.com/username/abcd1234/raw/myproxy.pac).

Tap Save (or the check‑mark) to apply the changes. Android will now download the PAC file and use it for all HTTP/HTTPS traffic on that Wi‑Fi network.

5. Verify the proxy is active

Open a browser and visit whatismyip.com. The site should display the IP address of proxy.example.com if the PAC file is working. To test the bypass rule, open a site under example.org; it should show your real home IP.

Alternatively, use the Android adb shell command to inspect the active proxy:

adb shell settings get global http_proxy

If the command returns proxy.example.com:8080, the proxy portion of the PAC file is being applied. Note that Android does not expose the raw PAC file content via settings, so manual verification via a web service is the most reliable method.

Troubleshooting

  • PAC file not reachable: Ensure the URL is reachable from the device (open it directly in the browser). A 404 or DNS error will cause Android to fall back to DIRECT for all traffic.
  • Syntax error in PAC file: Even a missing semicolon can break the entire file. Test the PAC file in a desktop browser (Chrome/Firefox support PAC URLs) before applying it to Android.
  • Proxy not applied to some apps: Android’s system proxy only affects apps that respect the system settings. Some VPN or security apps may override it. If an app still bypasses the proxy, check its own network settings.
  • Changing Wi‑Fi networks resets the proxy: The PAC configuration is tied to the specific SSID. You must repeat the steps for each Wi‑Fi network you want to use the proxy on.
  • Cellular data: Android does not support PAC for mobile data natively. To apply the same rules on cellular, you would need a VPN app that accepts a PAC file (e.g., “OpenVPN for Android” with a custom script) – outside the scope of this guide.

Safety and privacy considerations

Using a proxy routes all your HTTP/HTTPS traffic through a third‑party server. Even though the PAC file itself does not encrypt data, the underlying connections are still protected by TLS when you visit HTTPS sites. However, the proxy can see the domain names of encrypted connections (via SNI) and the full request URL for unencrypted sites. Only use proxies you trust, and consider adding certificate pinning or a VPN if you need end‑to‑end privacy.

Alternative methods

  • Third‑party apps: Apps like “ProxyDroid” (requires root) or “Every Proxy” (no root, uses VPN interface) can apply PAC rules system‑wide, including for cellular data.
  • VPN with PAC support: Some VPN clients allow you to import a PAC file and then split‑tunnel based on those rules. This gives you the same flexibility on both Wi‑Fi and mobile data.

With the steps above you now have a functional system‑wide PAC configuration for your Android Wi‑Fi network, without needing root access. Adjust the PAC rules as your needs evolve, and always verify that traffic is flowing through the intended proxy.

User Comments (0)

Add Comment
We'll never share your email with anyone else.