PackageDescription: Pac Parser

Pac Parser

Last published: April 16, 2012 by 'markpi'

Defines 1 Classes
Extends 1 Classes

pacparser is a library to parse proxy auto-config (PAC) files. Proxy
auto-config files are a vastly used proxy configuration method these days. Web
browsers can use a PAC file to determine which proxy server to use or whether
to go direct for a given URL. PAC files are written in JavaScript and can be
programmed to return different proxy methods (e.g. "PROXY proxy1:port; DIRECT")
depending upon URL, source IP address, protocol, time of the day etc. PAC files
introduce a lot of possibilities. Please look at the wikipedia entry for Proxy
auto-config ( for more

Needless to say, PAC files are now a widely accepted method for proxy
configuration management and companies all over are using them in corporate
environment. Almost all popular web browsers support PAC files. The idea behind
pacparser is to make it easy to add this PAC file parsing capability to any
program (C and python supported right now). It comes as a shared C library and
a python module which can be used to make any C or python program PAC scripts
intelligent. Some very useful targets could be popular web software like wget,
curl and python-urllib.

* Implementation
pacparser makes use of Mozilla's JavaScript interpreter SpiderMonkey to parse
PAC files (which are nothing but javascripts). Apart from that, proxy
auto-config standard assumes availability of some functions which are not
part of standard JavaScript. pacparser uses Mozilla's PAC implementation to
define all these functions except couple of dns functions which are defined by
pacparser itself. As a result, pacparser is as close to standard as it gets :)

The windows ( Win32 ) binaries are found here: