May 5, 2009

cygwin, wget and http_proxy

usually wget will automatically use the proxy setting defined in $http_proxy environment variable. Unfortunately, set http_proxy environment with command line tools (e.g. setx and setenv) does not work. Specifically, after the environment set up with the command line tools, if you type

c:\>set http_proxy
c:\>http_proxy=<your proxy setting>

But if you type

c:\>env | grep http_proxy

you get nothing.

I am pretty surprised here but no clue found on google. Fortunately, there is one way around. put the following line in the .wgetrc file in your home directory:

PS: the reason I need everything be put into command line script is I use a script to switch my work environment in corporate (where proxy effective) and home (no proxy at all).


Kerenoc said...

why not simply use
$export http_proxy=toto

Greenland said...

that's on windows env, there is no "export" available

gtirloni said...

If someone is using wget from cygwin, the correct location is /home/$user/.wgetrc under the Cygwin installation directory.

About Me

My photo