一、安装shadowsocks客户端
1、安装
apt-get install shadowsocks
pip install shadowsocks
2、更新shadowsocks配置文件
vim /etc/shadowsocks/config.json
{ "Server":"shadowsocks服务器IP" "Server_port": "local_port": 1080 "password":"xxxxxx" "timeout”:600 "method":"rc4-md5" }
3、启动shadowsocks
nohup /usr/bin/sslocal -c /etc/shadowsocks/config.json > /dev/null 2>&1 &
如果是pip安装
nohup /usr/local/bin/sslocal -c /etc/shadowsocks/config.json > /dev/null 2>&1 &
4、设置开机启动
启动代码写入开机配置文件
vim /etc/rc.local
5、如果出现错误
ERROR method rc4-md5 not supporteda
pip install shadowsocks --upgrade
或
pip install git+https://github.com/shadowsocks/shadowsocks.git@master
二、安装privoxy
1、安装
apt-get install privoxy
2、更新privoxy配置文件
vim /etc/privoxy/config
修改
listen-address [::1]:8118
为
listen-address 本机IP:8118
3、添加流量转发配置
forward-socks5t / 127.0.0.1:1080 .
4、启动privoxy
systemctl restart privoxy systemctl enable privoxy systemctl status privoxy
三、设置服务器代理
1、永久设置
vim /etc/profile
export http_proxy=http://127.0.0.1:8118 export https_proxy=http://127.0.0.1:8118
source /etc/profile
2、临时设置
export http_proxy=http://127.0.0.1:8118 export https_proxy=http://127.0.0.1:8118
3、测试
curl www.google.com