It is sometimes
necessary to run wget inside a network where a proxy requests
authentication, or when pacman must use a proxy that requires
authentication. The former can be achieved simply by defining two
variables, such as in ~/.bashrc (note that this example uses a proxy at
192.168.10.11, listening on port 8080):
Then, simply run wget with two extra arguments: --proxy-user="string" --proxy-passwd="string"
For example (Domain name: Wonderwall, username JohnDoe, password Go4It"):
wget --proxy-user "WonderwallJohnDoe" --proxy-passwd "Go4It" URL
It is possible to set an alias, which can again be done in ~/.bashrc, such as:
alias wget 'wget --proxy-user "WonderwallJohnDoe" --proxy-passwd="Go4It"'
Although this is a security risk, as the
password is readable by anyone that can read your .bashrc file, or view
your set aliases. Conversely, on any system where someone can read the
entire /proc tree, it is possible to view any argument passed on the
command line, such as the username and password.
Alternatively, you may set the username/password in the http_proxy/ftp_proxy variables:
To have pacman automatically use wget and the
proxy, define the environment variables (such as in ~/.bashrc) and
place the wget command into /etc/pacman.conf, in the [options] section:
XferCommand = /usr/bin/wget --proxy-user "domainuser" --proxy-passwd="password" --passive-ftp -c -O %o %u