Howto make wget working with proxy

It is sometimes necessary to run wget inside a network where a proxy requests authentication. This can be achieved by defining two variables, in current shell or in ~/.bashrc:

export http_proxy=”http://proxyserver:port”
export ftp_proxy=”http://proxyserver:port”

Means for example:

export http_proxy=”http://proxy.example.com:8080″
export ftp_proxy=”http://proxy.example.com:8080″

You can use ?proxy-username=”username” and ?proxy-passwd=”password” to set proxy user name and password where required. Replace user name with your proxy server user name and password with your proxy server password.

$ wget –proxy-user=”username” –proxy-passwd=”password” URL

Another alternative is to specify user and password in http_proxy / ftp_proxy environment variable as follows:

export http_proxy=”http://username:password@proxy.example.com:8080″

Then you can run wget as normal like:

$ wget URL