【k8s-11.1平台安装及应用配置指南】|centos 7配置socket5代理客户端

 一、安装工具

yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
pip install shadowsocks


 二、后台启动工具

nohup sslocal -s 【ssserver】 -p 【server port】 -b 127.0.0.1 -l 【local port】 -k 【password】 -m 【加密方式】&


 三、安装privoxy

yum install privoxy
vim /etc/privoxy/config
找到以下两句,确保没有注释掉
listen-address 127.0.0.1:8118   # 8118 是默认端口,不用改,下面会用到
forward-socks5t / 127.0.0.1:${port} . # 这里的端口写 shadowsocks 的本地端口(注意最后那个 . 不要漏了)

 四、启动privoxy

shellprivoxy --user privoxy /etc/privoxy/config


 五、安配置环境变量/etc/profile

vi /etc/profile
vi /etc/profile
根据自己需要 配置privoxy代理
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118
export ftp_proxy=http://127.0.0.1:8118
source /etc/profile
大功告成

注意:

如果不需要用代理了,记得把 /etc/profile 里的配置注释掉,不然会一直走代理流量。

1
unset http_proxy https_proxy

 六、配置docker代理

vim /usr/lib/systemd/system/docker.service
[Service]下增加
Environment=HTTP_PROXY=http://127.0.0.1:8118/
Environment=HTTPS_PROXY=http://127.0.0.1:8118/
Environment=NO_PROXY=localhost,127.0.0.1,m1empwb1.mirror.aliyuncs.com,docker.io,registry.cn-hangzhou.aliyuncs.com

systemctl daemon-reload
systemctl restart docker

640?wx_fmt=jpeg

640?wx_fmt=gif 作者:  贾捷(1992-)
硕士,美国纽约大学,中国联通研究院工程师  
方向:容器平台研究、java开发工作
联系方式:[email protected]

猜你喜欢

转载自blog.csdn.net/Z4a9Gx/article/details/81107564
今日推荐