yum
vim /etc/yum.conf
如果代理不需要用户名密码认证:
proxy=http://192.168.16.28:8118
如果需要认证:
proxy=http://192.168.16.28:8118
proxy_username=yezhou
wget
export http_proxy=http://192.168.16.28:8118
export https_proxy=http://192.168.16.28:8118
wget http://www.appblog.cn
或
wget -Y on -e "http_proxy=http://192.168.16.28:8118" http://www.appblog.cn
-Y:是否使用代理
-e:执行命令
curl
export http_proxy=http://192.168.16.28:8118
export https_proxy=http://192.168.16.28:8118
curl http://www.appblog.cn
curl -I http://www.appblog.cn
curl -v -I http://www.appblog.cn
或
curl -x 192.168.16.28:8118 http://www.appblog.cn
-x:设置代理,格式为host[:port],port的缺省值为1080
使用socks5代理方法:
--socks5-hostname host:port