Linux常用命令设置和取消代理

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
上一篇 Git设置和取消代理
下一篇 Maven设置Http代理
目录
文章列表
1 Vuex Do not mutate vuex store state outside mutation handlers
Vuex Do not mutate vuex store state outside mutation handlers
2
screen状态为Attached连接不上
screen状态为Attached连接不上
3
AWS配置RDS公网访问
AWS配置RDS公网访问
4
iOS微信支付接入(Swift)
iOS微信支付接入(Swift)
5
Genymotion模拟器无法开启的解决方法
Genymotion模拟器无法开启的解决方法
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。