安装ss
apt-get install python-pip
pip install shadowsocks
优化ss
vim /etc/sysctl.d/local.conf
# max open files
fs.file-max = 51200
# max read buffer
net.core.rmem_max = 67108864
# max write buffer
net.core.wmem_max = 67108864
# default read buffer
net.core.rmem_default = 65536
# default write buffer
net.core.wmem_default = 65536
# max processor input queue
net.core.netdev_max_backlog = 4096
# max backlog
net.core.somaxconn = 4096
# resist SYN flood attacks
net.ipv4.tcp_syncookies = 1
# reuse timewait sockets when safe
net.ipv4.tcp_tw_reuse = 1
# turn off fast timewait sockets recycling
net.ipv4.tcp_tw_recycle = 0
# short FIN timeout
net.ipv4.tcp_fin_timeout = 30
# short keepalive time
net.ipv4.tcp_keepalive_time = 1200
# outbound port range
net.ipv4.ip_local_port_range = 10000 65000
# max SYN backlog
net.ipv4.tcp_max_syn_backlog = 4096
# max timewait sockets held by system simultaneously
net.ipv4.tcp_max_tw_buckets = 5000
# turn on TCP Fast Open on both client and server side
net.ipv4.tcp_fastopen = 3
# TCP receive buffer
net.ipv4.tcp_rmem = 4096 87380 67108864
# TCP write buffer
net.ipv4.tcp_wmem = 4096 65536 67108864
# turn on path MTU discovery
net.ipv4.tcp_mtu_probing = 1
# for high-latency network
net.ipv4.tcp_congestion_control = hybla
# for low-latency network, use cubic instead
# net.ipv4.tcp_congestion_control = cubic
更新sysctl
sysctl --system
配置SS
vim /root/ss/ssserver.json
{
"server":"server_ip",
"server_port":端口,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"密码",
"timeout":300,
"method":"aes-256-cfb",
"fast_open":false
}
启动SS
sslocal -c /root/ss/ssserver.json -d start|stop
可能会遇到openssl更新废除了EVP_CIPHER_CTX_cleanup而报错:
AttributeError:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: EVP_CIPHER_CTX_cleanup
解决方案参考:https://blog.csdn.net/qq_27766969/article/details/71593611
安装polipo
sudo apt-get install polipo
配置polipo
sudo vim /etc/polipo/config
proxyAddress="0.0.0.0"
socksParentProxy="127.0.0.1:1080"
socksProxyType=socks5
chunkHighMark=50331648
objectHighMark=16384
serverMaxSlots=64
serverSlots=16
serverSlots1=32
重启polipo
sudo service polipo stop
sudo service polipo start
验证
http_proxy=“http://127.0.0.1:8123” curl ip.gs
或
export http_proxy=“http://127.0.0.1:8123”
curl ip.gs
长期使用代理
vim ~/.bashrc
alias gp="config --global http.proxy=127.0.0.1:8123"
alias hp="http_proxy=http://127.0.0.1:8123"
服务器重启后,重新执行
sslocal -c /root/ss/ssserver.json -d start
export http_proxy=“http://127.0.0.1:8123”
测试
hp curl ip.gs
Current IP / 当前 IP: 104.224.142.23 ISP / 运营商: it7.net City / 城市:
Piscataway Township New Jersey Country / 国家: United States IP.GS is
now IP.SB, please visit https://ip.sb/ for more information. / IP.GS
已更改为 IP.SB ,请访问 https://ip.sb/ 获取更详细 IP 信息! Please join Telegram group
https://t.me/sbfans if you have any issues. / 如有问题,请加入 Telegram 群
https://t.me/sbfans/_/
=( °w° )= ) ( // (__ __)//
hp wget www.google.com
–2019-01-14 05:07:26-- http://www.google.com/ Connecting to 127.0.0.1:8123… connected. Proxy request sent, awaiting response… 200 OK Length: unspecified [text/html] Saving to: ‘index.html.2’
index.html.2 [ <=> ]
11.06K --.-KB/s in 0s2019-01-14 05:07:27 (42.3 MB/s) - ‘index.html.2’ saved [11328]
配置proxychains
vim /etc/proxychains.conf
1. 开启 dynamic_chain
2. [ProxyList]注释socks4, 添加 socks5 127.0.0.1 1080
验证
proxychains curl ip.gs
ProxyChains-3.1 (http://proxychains.sf.net) |DNS-request| ip.gs
|R-chain|-<>-127.0.0.1:1080-<><>-4.2.2.2:53-<><>-OK |DNS-response|
ip.gs is 104.31.79.241
|R-chain|-<>-127.0.0.1:1080-<><>-104.31.79.241:80-<><>-OK Current IP /
当前 IP: 104.224.142.23 ISP / 运营商: it7.net City / 城市: Piscataway
Township New Jersey Country / 国家: United States IP.GS is now IP.SB,
please visit https://ip.sb/ for more information. / IP.GS 已更改为 IP.SB
,请访问 https://ip.sb/ 获取更详细 IP 信息! Please join Telegram group
https://t.me/sbfans if you have any issues. / 如有问题,请加入 Telegram 群
https://t.me/sbfans/_/
=( °w° )= ) ( // (__ __)//
打开火狐
proxychains firefox
切记:proxychains 和 polipo 同时只能存在一个
[完]