Android Proxy Settings: Wi-Fi, PAC and 407 Fixes
Set an Android Wi-Fi proxy to the Databay gateway, handle the missing credential fields, verify the exit in the browser, and use managed policy or the emulator for QA.
AndroidMobile operating systemgw.databay.co:8888Operating principle
Android stores the proxy on one saved Wi-Fi network with no credential fields, so authenticate only where an app prompts and verify each app’s exit.
How Android Scopes a Proxy to One Wi-Fi Network
Stock Android ties the proxy you set in Settings to one saved Wi-Fi network, not to the whole phone. Google's Pixel Phone Help gives the path: Settings, Network & internet, Internet, tap the network, tap Edit, open Advanced options, then pick a configuration type under Proxy. Device makers rename these screens, so if yours differ, search Settings for proxy, as Google's Android Help advises for any setting you cannot find.
The per-network design has four consequences for a Databay route:
- Scope. The proxy applies only while the phone uses that Wi-Fi network; mobile data and other networks keep their own routing.
- Credentials. The form has no username or password field, so the Databay credential can be supplied only where an app asks for it.
- Protocol. The form offers no SOCKS5 choice; use the gateway's HTTP mode on port
8888. - Coverage. Google's emulator documentation says browsers and most applications use the system proxy, but some apps may ignore it.
Use the route only for destinations you own or are permitted to test, such as your own site, your app's backend or ad placements you are authorized to verify, and follow each destination's terms. A proxy changes the network path, not what an account or site allows.
Map Databay Gateway Values to Android Proxy Fields
In the Android Open Source Project's Wi-Fi network dialog, the Proxy dropdown offers None, Manual and Proxy Auto-Config. Manual adds a hostname, a port and an exclusion list for hosts that should connect directly; Proxy Auto-Config adds a PAC URL. Vendor builds may relabel these controls; match them by purpose.
| Android control | Databay value | What to verify |
|---|---|---|
| Proxy dropdown | Manual, or Proxy Auto-Config (below) | You edited the network the phone is using now |
| Proxy hostname | gw.databay.co | No http://, path or trailing space |
| Proxy port | 8888 | Digits only |
| Exclusion list | Empty for the first test; later only local or internal hosts, comma-separated | databay.com is not listed, so the check uses the proxy |
| PAC URL | HTTPS address of a PAC file you host | The script returns PROXY gw.databay.co:8888 for every host under test |
| Username and password | No Wi-Fi field; the complete dashboard values go only into an app's proxy prompt | The prompt names the proxy, not a website sign-in |
| Protocol | HTTP proxying; HTTPS destinations use a CONNECT tunnel | No SOCKS5 choice exists in the stock form |
Before touching the phone, prove the credential from a laptop on the same Wi-Fi with the cURL proxy setup guide; if cURL fails there, no phone setting will fix it.
Use Proxy Auto-Config to Route Only Approved Hosts
Choose Proxy Auto-Config when only some destinations should leave through Databay. Android's ProxyInfo reference describes a PAC configuration as one that downloads and runs the script at the given URL. The script returns routing decisions, not credentials, so Manual mode's authentication limits still apply.
function FindProxyForURL(url, host) {
// The verification page and approved test hosts use the gateway.
if (host === "databay.com" || shExpMatch(host, "*.example.com")) {
return "PROXY gw.databay.co:8888";
}
return "DIRECT";
}Host the file on an HTTPS server you control, keep secrets out of it, and replace the example.com pattern with destinations you are permitted to test. Keeping databay.com in the rule lets the verification page share the work's path; everything else connects directly, off the per-GB route.
Answer the 407 Challenge Only Where an App Asks
Because the Wi-Fi form stores no credential, an app's first request to gw.databay.co:8888 arrives without one. Under RFC 9110, a proxy that requires authentication answers 407 Proxy Authentication Required with a Proxy-Authenticate challenge, and the client may repeat the request with a Proxy-Authorization header. Whether that retry happens depends on the app's own network code, not on Android:
- The app shows a proxy sign-in prompt. Enter the complete Databay username and password there, after checking that the prompt names the proxy at
gw.databay.co:8888; a website login form is not a proxy prompt. - The app fails with a connection or tunnel error while the browser works. It most likely received the challenge and cannot answer it; use the emulator route for QA, or an in-app proxy setting only where the app's developer documents one.
- The app keeps working from your normal IP. It is not following the system proxy; see the troubleshooting table.
Type the password only into that prompt: paste it from a password manager or secret store, keep screenshots and screen recording off while the prompt is open, and never paste it into tickets or chat. Let an app remember it only on a phone you control with a screen lock, since anyone holding the device can reuse the route, and rotate the credential if it appears in a capture or log.
Verify the Exit in the Phone Browser First
- With Proxy set to None, open Databay's What Is My IP page in the phone browser and note the direct address and location estimate as your control.
- Edit the same network to Manual with
gw.databay.coand8888, save, and reload the page. Answer the proxy prompt if the browser shows one. - Record the observed IP; the country, region and timezone estimate; the network name; the username's routing segments without the password; and the UTC time.
- Compare the observation with the route requested in the username. A matching country is evidence for that request only.
- Repeat the check inside each app that matters, against a destination you control that logs the source address, before the app opens its real backend.
The page reports the address one destination observed for one request. It is not proof of anonymity, of future routing, or that every app on the phone follows the same path. For machine-readable evidence, cURL on a laptop on the same network can request https://databay.com/what-is-my-ip/json with the credential.
Ready to run this for real?
Credentials appear in your dashboard in minutes, on the same gateway and username format this Android guide uses.
Pick the Databay Pool and Username Before Testing
Android does not choose the exit; the username does. Copy the complete username from the Databay dashboard instead of composing its grammar by hand. The documented pattern carries pool and country, as in USER-zone-residential-countryCode-us; a sticky session adds a sessionId segment, as in USER-zone-residential-countryCode-us-sessionId-abc123. Choose the pool from the test requirement, not the device type: Premium Residential targets one of country, state, city, ZIP, coordinate or ASN at a time, while Residential Flex, Datacenter and Mobile each target a country or continent.
All pools are shared, and none reserves an address for one customer. A sticky session requests continuity for up to 1440 minutes on Premium Residential and Residential Flex where available, or up to 120 minutes on Datacenter and Mobile. The IP can change before the window ends. Without one, a new proxy connection may select an available exit while a reused connection or tunnel may keep the same one; a different IP is not promised. Because browsers typically reuse connections, two page loads can show one exit and a later reconnect another, so for multi-page checks use a sticky username and re-verify at each checkpoint. Traffic is billed per GB and every app that honors the Wi-Fi proxy adds to it, so set the network back to None when the session ends.
Managed Phones: Android Management API Proxy Policy
On devices managed with the Android Management API, administrators can set the proxy by policy. The Policy resource's recommendedGlobalProxy field takes a ProxyInfo object, which Google describes as configuration for an HTTP proxy: host, port and excludedHosts for a direct proxy, where host names may use wildcards such as *.example.com, or pacUri for a PAC script.
{
"recommendedGlobalProxy": {
"host": "gw.databay.co",
"port": 8888,
"excludedHosts": ["*.corp.example.com"]
}
}Treat Google's caveats as stop conditions. The field description says proxies should typically be configured per network in openNetworkConfiguration, that network access may break if the proxy is not accessible, and that the global proxy is only a recommendation some apps may ignore. Google's network configuration guide adds that per-network ProxySettings is optional and supports only Manual and PAC. Neither shape has a credential field, so apps that follow the proxy but cannot answer a 407 will fail on every device that receives the policy. Pilot one test device, prefer pacUri when only approved hosts should use the gateway, and keep a policy version without the proxy ready for rollback.
Reproduce the Route in the Android Emulator
For repeatable app QA, the Android Emulator offers a mechanism that can carry the credential. Google's emulator proxy guide separates the Android System Proxy, the Wi-Fi setting inside the virtual device, from the Emulator Proxy, which routes all of the virtual device's TCP traffic through a proxy set with the -http-proxy flag or Extended controls. The command-line reference accepts http://server:port or http://username:password@server:port; this is the only place this guide shows a credential inside a URL, and the pattern does not belong in scripts or documentation:
# QA workstation only: both variables come from a secret store at launch
emulator -avd QA_Device \
-http-proxy "http://${DATABAY_PROXY_USER}:${DATABAY_PROXY_PASS}@gw.databay.co:8888"The expanded URL can be visible to other local users in process listings, and reserved password characters can break URL parsing, so run it only on a workstation you control, with shell tracing off and the line out of committed scripts and build logs; rotate the credential if it leaks. Google documents the two mechanisms as mutually exclusive, so leave the virtual device's Wi-Fi proxy at None. The Emulator Proxy tunnels HTTPS without decrypting it, has no exclusion list, does not redirect UDP, and needs a restart after Extended controls changes. Verify the exit in the emulator's browser before the app under test reaches its real backend.
Troubleshoot the Proxy Hop Before the Destination
Change one variable at a time, keep each failed observation, and start from the first layer that failed:
| Symptom on the phone | Layer | Next safe check |
|---|---|---|
| Nothing loads in proxied apps, or requests time out | Proxy hop: TCP to gw.databay.co:8888 | Re-check hostname and port, then test the credential with cURL from a laptop on the same Wi-Fi, which may block that port. |
| The proxy sign-in prompt keeps returning | Proxy hop: 407 authentication | Re-copy the complete username and password from the dashboard and remove stray spaces. |
| The browser works but one app shows a tunnel error | Proxy hop: the app cannot answer the 407 | Treat Wi-Fi-only setup as unsupported for that app and test it in the emulator. |
| One app reports your normal IP | The app ignores the system proxy | Per Android's ProxyInfo reference, HTTP stacks other than URLConnection and Apache HttpClient must read the proxy themselves; verify per app. |
| A hotel, office or guest sign-in page appears | Captive portal ahead of the proxy hop | Set Proxy to None, complete the portal sign-in, switch back to Manual and re-verify. |
| The proxy option is missing or locked on a work phone | Device policy | Ask the administrator; managed policy can turn off manual Wi-Fi configuration on fully managed devices. |
| A certificate warning on an HTTPS site | Destination TLS inside the CONNECT tunnel | Stop; do not continue past the warning or install an unknown certificate. |
| 401, 403, 429 or a CAPTCHA | Destination hop | Stop and use the destination's supported process; another exit is not permission. |
For background on the missing SOCKS5 option, see HTTP versus SOCKS5 proxies.
Questions specific to Android
Where are the proxy settings on an Android phone?
Why does Android not ask for a proxy username and password?
Does the Android Wi-Fi proxy also cover mobile data?
Can I enter a SOCKS5 proxy in Android Wi-Fi settings?
Why does one app show the proxy IP while another shows my normal IP?
How can I test an authenticated proxy in the Android Emulator?
Same gateway, different control surface
iPhone and iPad (iOS)
Mobile operating system
Settings -> Wi-Fi network info -> HTTP Proxy Manual -> Safari exit check
.NET HttpClient
HTTP client library
HttpClient -> SocketsHttpHandler.Proxy -> CONNECT or SOCKS5 -> observed exit
Pick the network once the route works. Residential for home-connection exits with state, city, ZIP and ASN targeting; datacenter for fast server IPs on public websites. Switching is one word in the username.
Where teams run Android behind the gateway: Proxies for mobile ad verification · Proxies for social media operations
Ship Android to production
Create an account, drop in your gateway credentials, and route your first Android request in minutes.
Pricing, order minimums, and traffic validity vary by product.