linux环境下设置shadowsocks+polipo全局代理

吾爱主题 阅读:146 2024-04-05 13:54:58 评论:0

1、安装shadowsocks
sudo apt-get install python-pip
sudo pip install shadowsocks


2、创建配置文件shadowsocks.json,其中服务器地址、端口号、密码为为购买或免费使用的服务器(比如www.ishadowsocks.org)

?
1 2 3 4 5 6 7 8 9 10 {   "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 }

3、启动shadowsocks
sslocal -c shadowsocks.json

4、安装polipo,进行二次转发(shadowsocks使用socks5协议通信,需搭配浏览器插件使用,若想要在系统全局使用,可使用polipo进行二次转发)
sudo apt-get install polipo

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

?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # 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

6、重启polipo服务
sudo service polipo restart

7、设置环境变量(可添加至~/.bashrc文件中使所有shell均可实现全局SOCKS5访问)
export http_proxy="http://127.0.0.1:8123"
export https_proxy="https://127.0.0.1:8123"

8、检测一下是否可以通过socks5协议获取google主页面
curl www.google.com
如果成功则说明可以访问。

总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对服务器之家的支持。如果你想了解更多相关内容请查看下面相关链接

原文链接:https://blog.csdn.net/Jailman/article/details/81388094

可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

【腾讯云】云服务器产品特惠热卖中
搜索
标签列表
    关注我们

    了解等多精彩内容