参考: http://wiki.archlinux.org/index.php/Proxy_settings
在教育网中使用aur或者abs,网速非常的慢,同时很多东西都不能正常的下载下来,如何给下载添加代理呢? 像wget等程序使用”protocal_proxy”环境变量,所以可以通过设置环境变量的方式来使用代理:
1 2
| export http_proxy=http://10.203.0.1:5187/ export ftp_proxy=http://10.203.0.1:5187/
|
我们可以增加两个函数用来打开关闭代理,在.bashrc里面添加:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| function proxy(){ echo -n “username:” read -e username echo -n “password:” read -es password export http_proxy=”http://$username:$password@proxyserver:8080/” export ftp_proxy=”http://$username:$password@proxyserver:8080/” echo -e “nProxy environment variable set.” } function proxyoff(){ unset HTTP_PROXY unset http_proxy unset FTP_PROXY unset ftp_proxy echo -e “nProxy environment variable removed.” }
|