首页 > 其他 > 详细

Lunux配置代理

时间:2020-07-04 17:24:35      阅读:56      评论:0      收藏:0      [点我收藏+]

Lunux配置代理

CentOS系统代理配置

一、Linux(Ubuntu/CentOS)设置全局代理上网

Linux 系统包含 Ubuntu、CentOS 等系统,设置方法都类似,都是修改配置文件

/etc/profile 或 ~/.bashrc 或 ~/.bash_profile

  • 1)Linux 系统设置临时全局代理

  • a)代理ip无密码授权

##无密码授权代理格式:

export http_proxy=http://ip:port
export https_proxy=http://ip:port

实例如下:

export http_proxy=http://178.63.41.235:9999
export https_proxy=http://198.229.231.13:8080

访问 http 和 https 网址

$ curl ‘http://proxy.mimvp.com/test_proxy2.php‘
{"remote_addr":"118.24.76.45","http_via":"null","client_ip":"null","http_x_forwarded_for":"null"}
$ 
$ curl ‘https://proxy.mimvp.com/test_proxy2.php‘
{"remote_addr":"118.24.76.45","http_via":"null","client_ip":"null","http_x_forwarded_for":"null"}

查看临时变量

$ echo $http_proxy
http://118.24.76.45:27423
$
$ echo $https_proxy
http://118.24.76.45:27423

取消临时变量

unset http_proxy
unset https_proxy

查看取消后的临时变量

$ unset http_proxy 
$ unset https_proxy
$ 
$ echo $http_proxy 
$ echo $https_proxy

详情参考

Lunux配置代理

原文:https://www.cnblogs.com/smqh-bokeyuan/p/13235581.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!