Use wget with Squid Proxy Server

by on August 28, 2010 · 0 comments· LAST UPDATED September 8, 2010

in

How do I make wget work with Squid under UNIX or Linux operating systems?

You need to define the shell variables as follows:

HTTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}
FTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}

You can put above two directives in a file called ~/.wgetrc:
echo 'HTTP_PROXY=192.168.1.254:3128'>> ~/.wgetrc
echo 'FTP_PROXY=192.168.1.254:3128'>> ~/.wgetrc

Now you can use wget:
$ wget http://example.com/file.tar.gz
You can also define shell variables as follows:
export http_proxy=http://192.168.1.254:3128/
OR you can pass the proxy username and password as follows:
wget --proxy-user=YOUR-USERNAME-HERE --proxy-password=YOUR-PASSWORD-HERE http://nixcraft.com/file.tar.gz

See also:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: