Linux 终端下使用代理访问网络
#export PROXY=http://ip:80/
这种环境变量设置只对当前环境有效,重启后设置将消失。
方法2:wget配置文件设置
#vi /etc/wgetrc
ftp_proxy = http://219.239.66.253:80/
http_proxy = http://219.239.66.253:80/
https_proxy = http://219.239.66.253:80/ (注意:无引号””)
方法3:wget命令行参数中设置
wget支持-e参数来进行代理设置
#wget -e “http_proxy=http://[username]:[password]@proxyip:port/” “http://www.baidu.com”
其中,-e, –execute=COMMAND 执行`.wgetrc’格式的命令,wgetrc格式参见/etc/wgetrc或~/.wgetrc记录和输入文件