#----------------------- #本代码将安装shadowsocks和privoxy #执行后再运行的apt-get等操作将通过shadowsocks以提高网络访问速度 # #适用场景: # 在优质网络服务器上搭建好ss后 用于 提升国内服务器/自己电脑的网速 # #PS: 如果您只需要简单开个代理,建议使用tinyproxy #----------------------- #安装shadowsocks,使用豆瓣源 mkdir -p ~/.pip echo """ [global] index-url = http://pypi.doubanio.com/simple/ [install] trusted-host=pypi.doubanio.com """>~/.pip/pip.conf pip install shadowsocks #在screen中运行sslocal screen -S ss sslocal ... #直接运行有参数说明的,这里就不细说了 #按下Ctrl+A d,测试一下: curl ip.cn --proxy socks5://127.0.0.1:1080 #安装privoxy: apt-get install -y privoxy echo """ user-manual /usr/share/doc/privoxy/user-manual confdir /etc/privoxy logdir /var/log/privoxy actionsfile match-all.action actionsfile user.action logfile logfile toggle 1 enable-remote-toggle 0 enable-remote-http-toggle 0 enable-edit-actions 0 enforce-blocks 0 buffer-limit 4096 enable-proxy-authentication-forwarding 0 forwarded-connect-retries 0 accept-intercepted-requests 0 allow-cgi-request-crunching 0 split-large-forms 0 keep-alive-timeout 5 tolerate-pipelining 1 socket-timeout 300 listen-address 127.0.0.1:8118 forward-socks5 / 127.0.0.1:1080 . """>/etc/privoxy/config service privoxy restart #安装好了privoxy就可以修改系统环境变量设置代理啦: export http_proxy="http://127.0.0.1:8118" export https_proxy="http://127.0.0.1:8118" #测试一下: curl ip.cn #大功告成~