Avoid “proxy.pac” Nightmares

Google saved my life today! I was busy to deploy a proxy.pac file at a customer premises. The problem with proxy.pac files is the difficulty to validate them. There are parsed by browsers and can quickly became a nightmare to be read by “poor humans”.

There is a project on Google Code called pactester. It does exactly what I was looking for: you can test your pac files “offline”:

Pactester is a tool to test Proxy Auto Configuration (PAC) files. PAC files are used by browsers to determine the ‘right’ proxy for a URL. Since the PAC file evaluation mechanism is generated inside the browser and cannot be accessed from outside, the only way to tell which proxy your browser will use for a specific URL is manual inspection of the PAC file.

Example:

# pactester -p proxy.pac -u http://www.yahoo.com -c 10.50.0.1
PROXY 192.168.0.1:8080

Once validated, you can safely deploy your new proxy.pac!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.