using wget through .pac config based proxy server

I want to use wget through a proxy which uses .pac config.

When I googled a bit, I found that .pac is a javascript file and wget cannot parse it based on the following url

http://www.linuxquestions.org/questions/linux-networking-3/i-want-to-use-wget-configured-with-a-wpad-dat-proxy-636922/

Is there any work around?

Thanks in advance


If the .pac file does not change too often (in my experience they do not), you can just read the file, and find the right proxy to give to wget.

If the file is too complex or changes a lot, you could write a small script in python using the pacparser library.


Quoted from http://www.gnu.org/software/wget/manual/html_node/Proxies.html

Wget supports proxies for both HTTP and FTP retrievals. The standard way to specify proxy location, which Wget recognizes, is using the following environment variables: http_proxy https_proxy

If set, the http_proxy and https_proxy variables should contain the URLs of the proxies for HTTP and HTTPS connections respectively


Check out the bash tool pacwget that does this using the pacparser library. It also robustly tries all combinations of proxies and servers.