欢迎来到代码驿站!

Linux

当前位置:首页 > 服务器 > Linux

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

时间:2021-04-29 10:55:10|栏目:Linux|点击:

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


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

{
 "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

# 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
如果成功则说明可以访问。

上一篇:grub损坏,开机出现GRUB 2 启动提示符的解决方法

栏    目:Linux

下一篇:Linux性能监控工具nmon安装及使用教程解析

本文标题:linux环境下设置shadowsocks+polipo全局代理

本文地址:http://www.codeinn.net/misctech/110888.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有