Docs menu
Docs

Automatic Proxy Setup: PAC Script and Configuration URL

A proxy configuration URL is the web address of a PAC (proxy auto-config) file, such as https://example.com/proxy.pac: a short JavaScript file whose FindProxyForURL function tells the browser or device, for each address, whether to use a proxy and which one. The same address goes by several names: "Script address" under Use setup script on Windows 11 and 10, "Automatic proxy configuration" on a Mac, Configure Proxy > Automatic on an iPhone, "Proxy Auto-Config" on Android and "Automatic proxy configuration URL" in Firefox. Chrome and Edge on Windows have no field of their own: they read the Windows setting, which chrome://settings/system > Open your computer's proxy settings opens. A PAC file can route the sites you choose through ProxyField's gateway, gate.proxyfield.io:7000, with residential proxies from $1.95/GB, and you can start with the Easy Trial: 1 GB for $2.95.

residential IPs
412M+
from, traffic never expires
$1.95/GB
Easy Trial
1 GB for $2.95
On this page 11 sections

Enter a PAC file address in Windows 11 or 10

Microsoft calls it a setup script. The steps are the same on Windows 11 and Windows 10 (Microsoft Support: Use a proxy server in Windows):

  1. Open Settings > Network & internet > Proxy.
  2. Under Automatic proxy setup, next to Use setup script, select Set up.
  3. In the Edit setup script dialog box, turn on Use setup script.
  4. Enter the PAC file's address in the script address box, for example https://example.com/proxy.pac.
  5. Select Save.

Leave Automatically detect settings off unless your network provides a script (see auto-detect and WPAD below). If you don't know the script address, it comes from whoever wrote the file: your company's IT team, or you. More Windows proxy options: Windows.

Enter a PAC file address in Chrome

Chrome has no PAC field of its own on Windows and macOS: it uses the system proxy setting.

  1. Open chrome://settings/system.
  2. Select Open your computer's proxy settings. On Windows this opens the Proxy page above; on a Mac, the network settings.
  3. Enter the PAC address there, in the setup script or automatic proxy configuration field, and save.

A PAC address typed into Chrome's address bar only opens or downloads the file: it configures nothing. For one Chrome session with its own script, start Chrome with --proxy-pac-url=https://example.com/proxy.pac. Edge works the same way. More on Chrome: Chrome.

Manual vs automatic proxy configuration

ModeWhat you enterWhat decides the proxyGood for
Manuala server and a port, such as gate.proxyfield.io:7000you: every request uses that proxy, except the exceptions listone proxy for everything
Automatic, with a script (PAC)a configuration URL, such as https://example.com/proxy.pacthe PAC file, per addressdifferent proxies for different sites, direct access for the rest
Auto-detect (WPAD)nothinga PAC file that the network announcescompany networks

Manual is simpler; automatic is more flexible. Most home users need neither, as what proxy settings are explains.

What a PAC file looks like

A PAC file defines one function. The browser calls it with each URL and host, and uses the string it returns (MDN: Proxy Auto-Configuration (PAC) file). This one, saved as proxy.pac and served at https://example.com/proxy.pac, sends two sites through ProxyField and everything else directly:

JavaScript
function FindProxyForURL(url, host) {
  // local names and private networks: never through the proxy
  if (isPlainHostName(host) || shExpMatch(host, "*.local") ||
      shExpMatch(host, "10.*") || shExpMatch(host, "192.168.*")) {
    return "DIRECT";
  }
  // only these sites go through the proxy
  // <port>: the port you set up in the dashboard for your allowlisted IP
  if (dnsDomainIs(host, ".example.com") || dnsDomainIs(host, ".example.org")) {
    return "PROXY gate.proxyfield.io:<port>; DIRECT";
  }
  return "DIRECT";
}
Return valueMeaning
DIRECTconnect without a proxy
PROXY host:portuse an HTTP proxy
HTTPS host:portuse a proxy reached over TLS (supported by some browsers)
SOCKS5 host:portuse a SOCKS5 proxy (SOCKS alone means SOCKS4 in some clients)
PROXY a:1; PROXY b:2; DIRECTtry them in order; the next one is used if one fails

Ending with DIRECT keeps sites loading if the proxy is unreachable; leave it out if those sites must never be reached without the proxy. Match on the host, not on the path: Chrome passes https:// URLs to the script without their path and query, as scheme://host:port/ (Chromium: proxy support in Chrome). Avoid isInNet() and dnsResolve() for every request where you can: they make a DNS lookup each time and slow browsing down.

ProxyField takes HTTP, HTTPS and SOCKS5, and SOCKS5 works with the allowlist too, so PROXY gate.proxyfield.io:<port> and SOCKS5 gate.proxyfield.io:<port> both work, where <port> is the port you set up in the dashboard.

Host the PAC file and get its URL

The configuration URL is just where the file lives. Serve it from any web server you control, ideally with the content type application/x-ns-proxy-autoconfig. For a quick test on your own computer:

Shell
python3 -m http.server 8000
# the configuration URL is then http://127.0.0.1:8000/proxy.pac

Support for file:// addresses varies by system and browser, so a web address is the reliable choice. Keep the file where every device that uses it can reach it, and remember that anyone who can reach the URL can read which sites you route and where.

Where to enter the configuration URL on other devices

Device or appSetting
Windows 11 and 10Settings > Network & internet > Proxy > Use setup script > Set up: turn on Use setup script, enter the address, Save (steps above)
MacSystem Settings > Network > Wi-Fi > Details > Proxies > Automatic proxy configuration: paste the URL
iPhone and iPadSettings > Wi-Fi > (i) > Configure Proxy > Automatic: paste the URL
AndroidWi-Fi network > edit or Advanced options > Proxy > Proxy Auto-Config: paste the PAC URL
FirefoxSettings > General > Network Settings > Automatic proxy configuration URL, then Reload
Chrome and Edgethe system setting, through chrome://settings/system > Open your computer's proxy settings; or --proxy-pac-url=<URL> at launch

Device-specific steps: Mac, iPhone, Android and Firefox.

Auto-detect and WPAD

"Automatically detect settings" (Windows) and "Auto proxy discovery" (Mac) use WPAD, the Web Proxy Auto-Discovery protocol: the device asks the network for a PAC file, through DHCP or by looking up a wpad host in the local domain, and downloads wpad.dat if it finds one. Company networks use it to configure every machine at once. On a home network nothing answers, and the device connects directly.

Because WPAD trusts whatever the local network announces, a hostile network could hand you its own script. On public Wi-Fi, turn auto-discovery off if you don't need it.

Route only some sites or apps through a proxy

Some sites: a PAC file is the built-in way, as in the example above. Browser proxy extensions with per-site rules do the same inside one browser (proxy switchers compared).

Some apps: PAC files only affect apps that read the system proxy, so per-app routing works differently:

  • Give each app its own proxy setting, if it has one (Firefox, Postman, antidetect browsers, game launchers).
  • For command-line tools and scripts, set the proxy variables only for that command (command line proxy); curl, for one, does not read PAC files.
  • On Windows and macOS, a proxy client such as Proxifier forces chosen apps through a proxy by rule, even apps without proxy settings.
  • On phones, the Wi-Fi proxy is used by the browser and some apps; per-app routing needs a proxy app (phone proxy settings).

PAC files and proxy logins

A PAC file returns only a host and a port; it has no place for a username and password. When the chosen proxy asks for a login, the browser shows a password prompt, and many apps simply fail. With ProxyField, add your device's public IP to the allowlist in your account, and the PAC file's PROXY gate.proxyfield.io:<port>, with the port you set up in the dashboard, works without any login (proxy authentication). Choosing the country, city or a sticky session without a username: with the allowlist, the product, location and session are set per port in the dashboard.

Refreshing and troubleshooting a PAC file

Browsers download the PAC file when the setting is applied, when the network changes and at startup, and keep it cached in between. After you edit it:

  • Chrome and Edge: restart the browser. Where your version still has it, chrome://net-internals/#proxy > Re-apply settings does the same without a restart.
  • Firefox: select Reload next to the URL in Network Settings.
  • Windows, Mac and phones: turn the setting off and on, or reconnect to the network.

If nothing goes through the proxy, check that the URL opens in a browser and shows the script as text, that the function is named exactly FindProxyForURL, and that the script has no syntax errors: a broken script usually means direct connections. To confirm the result, open the proxy checker on a site the script routes through the proxy.

Automatic Proxy Setup FAQ

What is a proxy configuration URL?

ProxyField residential proxies, from $1.95/GB, work with a proxy configuration URL: the web address of a PAC file, such as https://example.com/proxy.pac, a script that tells your device which sites go through a proxy such as gate.proxyfield.io:7000 and which connect directly. You paste the URL into the automatic proxy or setup script setting.

What is a proxy configuration URL, and where do I enter a PAC file address in Chrome or Windows?

It is the address of a PAC file, a script that picks a proxy or a direct connection for each site. In Windows 11 or 10, go to Settings > Network & internet > Proxy, select Set up next to Use setup script, turn it on, enter the address and select Save. Chrome reads that Windows setting: chrome://settings/system > Open your computer's proxy settings opens it.

What does a PAC file address look like?

An ordinary web address ending in the file's name, such as https://example.com/proxy.pac or http://127.0.0.1:8000/proxy.pac for a file served on your own computer. Networks that use auto-detection serve it as wpad.dat. It is different from a manual proxy address such as gate.proxyfield.io:7000, which is a host and a port.

What is the difference between manual and automatic proxy configuration?

Manual configuration uses one server and port for everything except an exceptions list. Automatic configuration loads a PAC script, from a URL you enter or one the network announces, which picks a proxy or a direct connection for each address.

What does automatic proxy setup mean?

It means the device gets its proxy rules from a script instead of typed values: either a configuration URL you enter, or auto-detection (WPAD), where the network announces the script. On a home network, auto-detection finds nothing and changes nothing.

Can I route only some apps through a proxy?

Yes, but not with a PAC file alone, which only affects apps that read the system proxy. Set the proxy inside each app that has a setting, set proxy variables only for the commands that need them, or use a rules-based proxy client that sends chosen apps through the proxy.

How do I use a proxy for one site only?

Write a PAC file that returns PROXY host:port for that site's domain and DIRECT for everything else, host it, and enter its URL as the automatic proxy configuration. A browser proxy extension with a per-site rule does the same in one browser.

How do I set a PAC URL in Chrome?

Chrome uses the system setting, so open chrome://settings/system, select Open your computer's proxy settings and enter the URL in the setup script or automatic proxy field there. For one Chrome session, start Chrome with --proxy-pac-url= followed by the URL; pasting the URL into the address bar configures nothing.

Can a PAC file send traffic through a SOCKS5 proxy?

Yes: return SOCKS5 host:port. Write SOCKS5 rather than SOCKS, which some clients read as SOCKS4, and use an IP allowlist, because the PAC file cannot carry a login. With ProxyField, SOCKS5 works with the allowlist: return SOCKS5 gate.proxyfield.io:<port>, with the port you set up in the dashboard.

Does curl use PAC files?

No. curl does not run PAC scripts or read the system's automatic proxy setting; give it the proxy with -x, as in curl -x gate.proxyfield.io:7000 -U "<login>-country-us-city-new_york:<password>" https://api.ipify.org, or with the HTTPS_PROXY variable.

Show 5 more questionsShow fewer questions

How do I use Proxy Auto-Config on Android?

Open the Wi-Fi network's settings, choose edit or Advanced options, set Proxy to Proxy Auto-Config and paste the PAC URL. It applies to that Wi-Fi network only, and the browser and apps that read the system proxy follow it.

When should I use automatic proxy configuration?

Use it when different sites need different proxies, or some sites must connect directly, or when many devices should share one set of rules you update in one place. For a single proxy on one device, a manual setting is simpler.

How often does the browser refresh the PAC file?

Browsers load it when the setting is applied, at startup and when the network changes, and cache it in between. After editing the file, restart Chrome or Edge, or use Reload in Firefox's Network Settings.

What is the difference between auto-detect and a PAC file?

A PAC file is the script itself; auto-detect (WPAD) is a way of finding one, by asking the local network where its script is. With a configuration URL you point the device at a script yourself.

Can a PAC file include a proxy username and password?

No. A PAC file returns only hosts and ports, so a proxy that needs a login makes the browser show a password prompt, and some apps fail. Use an IP allowlist with the proxy provider so the PAC file's proxy works without a login.

Easy Trial: 1 GB for $2.95.

Try for the price of 1 GB, no subscription, traffic never expires.