Coder Perfect

How do I configure wget to use a proxy?


I’d like to use wget to download something using a proxy:

HTTP Proxy:
Port: 8080

There is no need for a login or password for the proxy.

I’m not sure how I’m going to accomplish it.

Asked by Hakim

Solution #1

For all system users via /etc/wgetrc, or for a single user via the /.wgetrc file:


Alternatively by using the -e arguments after the URL:

wget ... -e use_proxy=yes -e http_proxy= ...

Answered by amaksr

Solution #2

In the command line, type:

$ export http_proxy=http://proxy_host:proxy_port

for authenticated proxy,

$ export http_proxy=http://username:password@proxy_host:proxy_port

and then run

$ wget fileurl

Use https proxy instead of http proxy for https. You may also put these lines in your /.bashrc file to avoid having to run them every time.

Answered by shivshnkr

Solution #3

Uncomment the following possible configs in /etc/wgetrc and use them…

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy =
#http_proxy =
#ftp_proxy =

# If you do not want to use proxy at all, set this to off.
#use_proxy = on

Answered by hovanessyan

Solution #4

wget uses environment variables somthing like this at command line can work:

export http_proxy=http://your_ip_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,"

Answered by juan_liga

Solution #5

After attempting numerous tutorials to set up my Ubuntu 16.04 LTS behind an authorized proxy, I found success with the following steps:

Edit /etc/wgetrc:

$ sudo nano /etc/wgetrc

Uncomment these lines:

#https_proxy =
#http_proxy =
#ftp_proxy =
#use_proxy = on

Replace with http://username:password@domain:port/username:password@domain:port/username:password@domain:port/user

Answered by Janderson Silva

Post is based on