5

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

4 Answers 4

1

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.

1

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

1

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

0

We had to integrate some proxy support in some of our tools (Windows based only) and in order to validate our implementation, we created a "wget" utility (named VVGet) that can use proxies based on WPAD or PAC files (autoproxy).

This tool is currently available for free, here: http://win10wiwi.com/dlfiles/VVGet.exe

If WPAD is enabled or if there is an AutoProxy/PAC file available to a client system configuration in such a way that Internet Explorer or Windows Update can go through a proxy, VVGet should also be able to do it. At least if there is no authentication needed. Basic proxy authentication is supported in VVGet (specifying proxy manually).

Edit: VVGet is now an opensource project that one can find on github: https://github.com/MrTheV/VVGet/

The ReadMe.txt file says this:

PURPOSE ETC. This program is a Delphi for Windows implementation of a WGet-type tool. Its major advantage is that it can use AutoProxy features by relying on WinHTTP AutoProxy subsystem. Then, if AutoProxy is available, either through DNS, DHCP, JavaScript URL or by other configuration means, VVGet can fetch a file using said automatic proxy. Manual Proxy is also supported. AutoProxy is considered enabled if parameters from Windows/InternetExplorer specify that "Auto Detect Proxy" is set. See WinHttpGetIEProxyConfigForCurrentUser function and https:msdn.microsoft.com/fr-fr/library/windows/desktop/aa384240(v=vs.85).aspx Warning : Integrated Proxy Authentication with Windows Credentials has not been fully tested and may not work as expected. DEPENDENCIES VVGet is built using Indy 10. A recent version of Indy10 (after 2016/01/10 (YYYY/MM/DD)) is required in order to support fetching files over SSL/TLS when Client-side SNI support is required such as when using shared hosting in which several host names share the same IP address. See http:www.indyproject.org/Sockets/Blogs/ChangeLog/20160110B.en.aspx If you get an EIdOSSLUnderlyingCryptoError Exception when fetching a file over https, your Indy version may be too old. Get a recent Indy 10 from http:www.indyproject.org/ VVGet embeds OpenSSL DLLs, in order to be self contained. The DLLs are embedded as binaries in the resources, extracted to a subfolder in %TEMP% and %PATH% is adjusted so that the extracted OpenSSL DDLs are used by VVGet. In order to use OpenSSL DLLS suitable with Indy, with no dependencies, check this link: http:indy.fulgan.com/SSL/*

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .