PAC (Proxy Auto Config) file is simply Javascript that has function FindProxyForURL
returning proxy config string.
Technically, this function can use anything that Javascript can do, so you must bundle some Javascript engine to interpret it.
tiny-js
(simple single-file javascript interpreter written in C++) is the library that should fit the bill for this task.
UPDATE: pacparser
library is pretty much ready-to-use engine designed specifically to parse pac files. Its downside that it bundles whole SpiderMonkey
Javascript engine, which makes it rather heavy solution - it would add 1MB+ to your project binaries just to parse pac
files.
If you can hack pacparser
to use tiny-js
instead of SpiderMonkey
, that would be really nice solution.