December 18, 2007

pacparser - a library to parse PAC files

As I mentioned earlier also, proxy auto-config (PAC) files are becoming more and more important for web proxy usage because of automation and ease of administration provided by them. Almost all popular browsers today support them. But, there is still a dearth of tools available for processing PAC files e.g. popular web software like curl, wget and python-urllib still don't take PAC file for proxy configuration.

That was the problem I wanted to solve when I started to work on pacparser. Now it's ready in full glory - From the release announcement:

I am very pleased to announce the release of "pacparser" - a C library to parse proxy auto-config (PAC) scripts. Needless to say, PAC files are now a widely accepted method for proxy configuration management and almost all popular browsers support them. The idea behind pacparser is to make it easy to add this PAC file parsing capability to other programs. It comes as a shared C library with a clear API. You can use it to make any C or python (using ctypes) program PAC scripts intelligent. Some very useful targets could be popular web software like wget, curl and python-urllib.

For documentation and available packages, please visit project home page at:

For the ones who like to start with source code, here is the link to direct download for source code:

I hope you will find some use for it. Anyway, let me know how your find it :-)

Cheers :-),

Update: For easy installation on Ubuntu boxes, I have created debs for Ubuntu gutsy for i386 and amd64 platforms. These debs can be downloaded from here:
Manu Garg/"Journey is the destination of life"


  1. Awesome Manu, not sure I understand and I need it but I admire your contribution to Open Source.

    -- Srikanth

  2. Looks great; however, I can't seem to link this in VisualStudio 2005.

  3. Hey philip, thanks for the feedback. I could not test it on VS2005, as I didn't have it on my machine. However, I tried it with mingw tools, so it should work with VS too. I'll give it a try on one of my friend's PC. Please write to pacparser discussion group ( in case you have any further information or feedback.

  4. I have released a new version (1.0.1) of pacparser package which includes import library for Visual Studio. Please see the post: on how to link in pacparser on visual studio.

  5. Hi, i tried using your pacparser for java by creating a JNI. Sometimes, the init failed, may i know what are the reasons that the init may fail?

  6. Hello Manu,

    Thanks for sharing open source pac parser library. Its very helpful. I want to try this library for android app development by JNI. Could you please let me know how i can achieve this?