Use wget with Squid Proxy Server

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:

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts