How To Use Wget using Proxy Server

How To Use Wget using Proxy Server

Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS, the most widely used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.

Sometimes we need wget to use proxy, for example if you behind firewall or using proxy on your office or school.

There are many ways to use wget using proxy such as using wget command without change configuration, create / edit configuration in $HOME/.wgetrc (~/.wgetrc) or /etc/.wgetrc, and export proxy configuration globally for all application.

Using Wget Command without change configuration

# wget -e use_proxy=yes -e http_proxy=


# wget -e use_proxy=yes -e
Wget Command Using Proxy
Wget Command Using Proxy

Create / edit configuration in $HOME/.wgetrc (~/.wgetrc) or /etc/.wgetrc

If you create on ~/.wgetrc it’s only available on your profile and if edit on /etc/.wgetrc, ot’s will available globally. So it;s depend on your choices.

# vi ~/.wgetrc

Paste code below

http_proxy = http://[proxy_address]:[proxy_port]
https_proxy = http://[proxy_address]:[proxy_port]
ftp_proxy = http://[proxy_address]:[proxy_port]


http_proxy =
https_proxy =
ftp_proxy =

Export proxy configuratioinglobally for all application

This configuration is available for all application such as homebrew.

export http_proxy=[proxy_address]:[proxy_port]
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export dns_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,,localaddress,"

Leave a Reply

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