Fix a PAC file that will not work
We'll confirm the PAC URL loads, check the JavaScript and FindProxyForURL logic, rule out caching—or tell you when to contact IT.
What you'll need
- PAC file URL (from IT or your network admin)
- Browser or app that uses the PAC
Step-by-step diagnostic
Quick triage — pick your path
Quick triage — pick your path
Choose the option that matches what you see. You can jump straight to that section.
- Follow this guide Work through the full procedure from PAC URL to testing.
- Check PAC URL and content You want to verify the PAC file loads and has valid JavaScript.
- Test with DIRECT You want to isolate whether the PAC logic is wrong.
- When to contact IT The PAC is corporate-managed or you cannot fix the JavaScript.
Show full guide
Steps
Goal: Confirm the PAC URL loads, check the JavaScript and FindProxyForURL logic, and rule out caching.
- Open the PAC URL in a browser (e.g.
http://proxy.company.com/proxy.pac). You should see JavaScript, not a 404 or error page. - Good: The PAC loads—proceed to Check PAC content.
- Bad: 404 or error—the PAC URL is wrong or the server is down. Contact IT. See When to get help.
Check PAC URL and content
Goal: Verify the PAC file has valid JavaScript and FindProxyForURL.
- The PAC must define
function FindProxyForURL(url, host) { ... }and return a string:"DIRECT","PROXY host:port", or"SOCKS host:port". - Check for JavaScript syntax errors (missing brackets, semicolons). Use a linter or paste into a JavaScript console.
- Good: FindProxyForURL exists and returns correctly—proceed to Test with DIRECT.
- Bad: Function missing or syntax errors—fix the JavaScript or contact IT.
Test with DIRECT
Goal: Isolate whether the PAC logic is wrong.
- Create a minimal PAC:
function FindProxyForURL(u,h){return "DIRECT";}and host it or point to it. Set the browser to use this PAC. - If everything works with DIRECT, the original PAC logic (routing rules) is likely wrong.
- Good: DIRECT works—the original PAC logic needs fixing. Compare with a working PAC or contact IT.
- Bad: Even DIRECT fails—the issue may be PAC URL, caching, or browser. Clear cache, try manual proxy. See When to get help.
When to get help
- The PAC URL returns 404 or the server is down.
- The PAC is corporate-provided and you cannot edit it.
- You have fixed the JavaScript and cleared cache but it still fails—the proxy in the PAC may be down; contact IT.
Verification
- The PAC URL loads in a browser and shows JavaScript.
- FindProxyForURL exists and returns a valid string.
- Traffic routes as expected: internal sites direct, external sites via proxy (or per your PAC logic).
- No proxy-related errors in the browser or app.
Escalation ladder
Work from the device outward. Stop when the problem is fixed.
- Confirm PAC URL loads Open the PAC URL in a browser; verify JavaScript, not 404.
- Check FindProxyForURL Verify the function exists and returns a valid string.
- Test with DIRECT Use a minimal PAC that returns DIRECT to isolate logic.
- Clear cache Clear browser and OS cache; reload PAC.
- Contact IT Corporate PAC—IT must fix the file or server.
What to capture if you need help
Before calling support or posting for help, have these ready. It speeds everything up.
- PAC file URL
- Browser and OS
- Whether the PAC URL loads (200 vs 404)
- Error messages if any
- Steps already tried
Does the PAC URL load (not 404)?
Open the PAC URL in a browser. You should see JavaScript.
You can change your answer later.
Does FindProxyForURL exist and return a string?
The PAC must define FindProxyForURL and return DIRECT, PROXY host:port, or SOCKS host:port.
You can change your answer later.
Did you clear cache and reload?
Browsers cache PAC files. Clear cache or use private window.
You can change your answer later.
Fix the JavaScript
Contact IT
Done
Reviewed by Blackbox Atlas
Rate this guide
Was this helpful?
Thanks for your feedback.