This is a C library for handling proxy autoconfiguration files. You can also use it to test your PAC files.
pac_init, and it will be called when a worker thread finished executing your PAC code. You can then schedule an event for your main event loop with the result.
automake. For the first time, you need to generate
$ autoreconf -i
Then build libpac:
$ ./configure $ make
To run tests:
$ make check
Note: with old versions, you needed
tests/test_pac.c for an example on how to use
Testing your PAC file
You can use
tests/test_pac to test your PAC file. It takes the path for your PAC file as its first parameter, then an URL and a hostname. E.g.:
$ ./tests/test_pac ~/pac.js http://mysite.com mysite.com Found proxy PROXY 184.108.40.206:8080; PROXY 220.127.116.11:8080
PAC files can return one or more proxies, or "DIRECT" for a direct connection.
You can also call
test_pac with multiple URL/hostname pairs:
$ ./tests/test_pac ~/pac.js http://mysite.com mysite.com http://mysite.net mysite.net Found proxy PROXY 18.104.22.168:8080 Found proxy PROXY 22.214.171.124:8080