Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If ran without parameters my wget prints:

D:\>wget
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = c:/progra~1/wget/etc/wgetrc
D:\Apps\Util\wget: missing URL
Usage: D:\Apps\Util\wget [OPTION]... [URL]...

Try `D:\Apps\Util\wget --help' for more options.

This probably means, that is looks for file wgetrc in c:/progra~1/wget/etc/wgetrc. Unfortunately, this location is unavailable for non-root programs. I was thinking I can modify SYSTEM_WGETRC or syswgetrc environment variables, but this looks having no effect

D:\>echo %SYSTEM_WGETRC%
d:\apps\util\wgetrc

D:\>echo %syswgetrc%
D:\APPS\Util\wgetrc
share|improve this question
    
Ouch that is so darn weird. Why do you get forward slashes c:/ ? It should be C:\ – barlop Jan 1 '13 at 19:49
    
also funny that your wget tells you about wgetrc, mine doesn't. Maybe we have some setting different. But what version of wget do you have? – barlop Jan 1 '13 at 20:04
    
You should accept an answer – barlop Feb 18 '15 at 23:59

wget --help doesn't tell you much. For more detail you can check the online wget manual Or man wget (they are different things, it's often worth checking each)

In short, here's an example

C:\sdf>wget -e http_proxy=127.0.0.1:8118 www.google.com

and another

C:\sdf>set http_proxy=127.0.0.1:8118
C:\sdf>wget www.google.com

The manual mentions wgetrc commands. You see some things about http proxies listed there.

6.3 Wgetrc Commands

  • http_proxy = string
    Use string as http proxy, instead of the one specified in environment.
  • https_proxy = string
    Use string as https proxy, instead of the one specified in environment.

8.1 Proxies

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.

added

Regarding the wget man page and the "wget manual".

Man pages at the command line are up to date, but the manual(a different entity from manpage), is not always an up to date wget version. As of writing(sept 2015) it is. http://www.gnu.org/software/wget/manual/wget.html You can see the version at the top and check if it's the latest http://ftp.gnu.org/gnu/wget/ it shows dates too. (You see on archive.org that in e.g. Nov 2013 the gnu manual was very out of date. In Nov 2013 even March 2014, they were still showing wget 1.13.4 which was from 2011)

For the manpage, if you're checking from command line then it must be the version you're using so you can be fine there by just making sure your command is up to date / updating it. You may want to check that the/any online source you are using is showing the latest man page. This one seems fine https://www.kernel.org/doc/man-pages/ links to http://man7.org/linux/man-pages/man1/wget.1.html You can also check the version there against the ftp link to make sure it's the latest version.

share|improve this answer
    
In Dec 2013, it was the case that man wget had a more recent version than the webpage. e.g. --content-on-error was on that 2013 man wget page, but not on the wget online manual that lists the options. So the webpage isn't always up to date. Though as mentioned in my answer, as of Sept 2015, the webpage is up to date. – barlop Sep 22 '15 at 7:03

I think you just want to set the HTTP_PROXY environment variable.

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.

share|improve this answer

barlop's answer in general is fine, but a few comments:

on the dos/windows command line or batch file, you specify

set http[s]_proxy=http[s]://proxyserver:port/

then wget works fine.

it will usually also take your windows single sign-on credentials if you are in a company network with NTLM authentication against the proxy (no need to hassle around with domain - backslash - user)

share|improve this answer

You must log in to answer this question.

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