Linux 下 shadowsocks + polipo 客户端全局代理

shadowsocks

## Ubuntu 下的安装
sudo apt-get install python-pip
sudo pip install shadowsocks

## CentOS 下的安装
yum install python-setuptools && easy_install pip
pip install shadowsocks

建立配置文件,例:服务器地址为 xxxx.com,端口号 52239,密码 SOME_PASSWORD,保存到 ~/shadowsocks.json

{
	"server": "xxxx.com",
	"server_port": 52239,
	"local_address": "127.0.0.1",
	"local_port": 1080,
	"password": "SOME_PASSWORD",
	"timeout": 600,
	"method": "aes-256-cfb",
	"fast_open": false
}
## 启动 shadowsocks
sudo sslocal -c ~/shadowsocks.json -d start

安装 polipo

使用 polipo 进行二次转发

## Ubuntu 下的安装
sudo apt-get install polipo

## CentOS 下的安装
sudo yum install polipo

编辑配置文件,保存到 /etc/polipo/config

# This file only needs to list configuration variables that deviate
# from the default values.  See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.

logSyslog = true
logFile = /var/log/polipo/polipo.log

proxyAddress = "0.0.0.0"

socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5

chunkHighMark = 50331648
objectHighMark = 16384

serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32
## 重启服务
sudo service polipo restart

如果需要终端使用代理,需要设置环境变量:

export http_proxy="http://127.0.0.1:8123"
export https_proxy="http://127.0.0.1:8123"
export ftp_proxy="http://127.0.0.1:8123"

可以将此脚本放到 /etc/profile 文件中以便开机启动。

全局代理

在Ubuntu中可以使用系统自带的network proxy工具实现,见截图:

 

 

 

 

 

参考链接:

https://fqk.io/linux-shadowsocks-global/

https://www.jianshu.com/p/41378f4e14bc

http://dearmadman.com/2015/08/30/use-shadowsocks-in-ubuntu/
https://wiki.archlinux.org/index.php/Polipo_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
http://blog.xdq.me/centos-7-an-zhuang-polipo/

 

 

Leave a Reply

Your email address will not be published.