How to test a proxy.pac file (online, with pactester, and in the browser)

Published · updated

How do you test a proxy.pac file? You ask its FindProxyForURL function the questions your users will ask, which URLs go where, in the engines your users actually run. Here are three ways to do it, from quickest to most realistic.

How do I test a PAC file online?

The quickest check is an online PAC file tester. On findproxyforurl.net/check/:

  1. Paste the file, or open it with Load file….
  2. Enter the domain or URL you care about above the editor. A domain alone is tested as https://.
  3. If a rule uses myIpAddress(), enter the client IP as well.
  4. Choose the engine profile. There are five: Chromium, Firefox, pacparser, and two Windows profiles (WinHTTP and WinINet).
  5. Press Check.

The editor area switches to the Path tab. It shows a live trace of your file for that URL: the order in which the lines ran, true or false for every if test, every built-in call with its arguments and result, and the return that decided. To compare engines, choose another profile and press Check again. The tester also runs probe URLs built from the domains in your file, and it rates the file against the rule catalogue. When a URL goes the wrong way, the article PAC file troubleshooting lists the usual causes. The file is evaluated in your browser, and only its logical shape is sent for the rating (methodology).

How do I test a PAC file on the command line?

pactester is the command-line tool of the pacparser library:

pactester -p proxy.pac -u http://www.example.com/
pactester -p proxy.pac -u https://intranet.corp.example/ -c 10.1.2.3

-p names the PAC file, -u the URL, and -c sets the client IP address that myIpAddress() returns (source: doc, pactester manual, checked 2026-10-06). It is ideal for scripts and CI: keep a list of URLs with the expected answers and fail the build when one changes. The article testing PAC files in CI with pactester has a script for that.

pactester is one engine, and the browsers answer differently from it for some calls and see less of the URL; pactester vs Chrome and Firefox lists where.

How do I test it in the browser itself?

For the clients you actually deploy to, test there too: load the file in a test profile of Chrome, Edge or Firefox and record which proxy was chosen. The debugging guide for Chrome, Edge and Firefox shows the start options, the settings and the logs.

Which URLs should I test?

A test is only as good as its URLs. For each rule in the file, test one URL that should match and one that should not. Then add the cases that break PAC files in practice:

Test URLWhat it catches
http://evilcorp.example/ when the file trusts corp.examplemissing leading dot (PAC-X003)
http://www.example.net/?r=partner.example.comsubstring match on url (PAC-C001)
http://corp.example.attacker.test/trailing * in a host pattern (PAC-X002)
http://10.1.2.3/ and http://192.168.1.10/private ranges, IP literals
http://intranet/plain host names
a URL that matches no rulethe default route exists (PAC-X001)

The online tester generates most of these probes for you from the domains in your file.

When does a PAC file pass the test?

  • Every URL returns a string in every engine; an exception or undefined means a direct connection in browsers.
  • The default route is the last statement, and it is commented.
  • No DNS functions run for ordinary requests (DNS in PAC files).
  • All engines agree, or you know why they do not. Check the important URLs once in each engine profile your users run.

The A+ grade in the tester covers the first three points. If you want a file that already passes as a starting point, copy one of the PAC file examples or build one with the PAC file generator.

Frequently asked questions

How do I test a proxy.pac file?

Paste it into an online PAC file tester such as findproxyforurl.net/check/, enter a domain or URL, choose the engine profile and press Check. A live trace shows the result, every test with true or false, every built-in call with its result and the line that decided, and the file is rated with a list of problems. For scripts and CI, run pactester from pacparser with a list of URLs and expected answers. Before a roll-out, confirm the important URLs in the browsers and on Windows.

How do I test a PAC file on the command line?

Install pacparser and run "pactester -p proxy.pac -u http://www.example.com/". Add -c with an IP address to set what myIpAddress() returns. pactester answers for the pacparser engine only.

Which URLs should I test?

One URL per rule in the file, plus the cases attackers use. Try look-alike domains (evilcorp.example for corp.example), trusted names inside a query string, IP addresses, plain host names and an https:// URL with a path.