apt-get install python-pip python-gevent python-m2crypto
2. 安装shadowsockspip install shadowsocks
sudo nano /etc/shadowsocks.json
配置文件内容如下。
{
"server":"SS服务器ip地址",
"server_port":443,
"local_address":"192.168.1.188",
"local_port":1080,
"password":"your-passwd",
"timeout":300,
"method":"aes-256-cfb",
"fast_open":false,
"workers":10
}
配置文件说明
SS服务器ip地址,请填你的服务器 IP 地址。不确定的话,去服务器上查看。
"server_port",请填写你的 SS服务 端口。不确定的话,去服务器上看你的SS配置。
"local_address":"192.168.1.188",这个是我树莓派在本地的 IP 地址,供给本地机器使用
"local_port":1080,是我供给本地机器使用的端口
"password":"your-passwd",填写服务密码。确保和服务器上写的一样。
"timeout":300,以下全部和远程服务器保持一致
"method":"aes-256-cfb",
"fast_open":false,
"workers":10
4添加到开机自启动
sudo nano /etc/rc.local
在 exit 0 之前写入这一行
/usr/local/bin/sslocal -c /etc/shadowsocks.json -d start
5重启树莓派
sudo reboot
在任一和树莓派同局域网内的本地机器
chrome安装 Proxy SwitchyOmega 插件,新建情景模式-》模式 代理服务器,
代理协议 SOCKS5
代理服务器192.168.1.188
代理端口1080
应用设置,直接就可以打开一些被墙的网站
获取免费的ss账号:
# encoding:utf-8
import requests
import re
url = ["http://freessr.top", "http://www.ishadowsocks.com"]
def get_iss(url):
head={'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36'}
data_handle=requests.get(url,headers=head);
data_handle.encoding='utf-8'
data=data_handle.text;
server=re.findall('<h4>(.*?)</h4>',data,re.S);
list = []
ls = []
for each in server:
#print each
info = each.encode("utf-8")
if "服务器地址:" in info:
list.append(info.rsplit(":")[1])
if "端口:" in info:
list.append(info.rsplit(":")[1])
if "密码:" in info:
list.append(info.rsplit(":")[1])
if "加密方式:" in info:
list.append(info.rsplit(":")[1])
if "状态:" in info and "正常" in info:
#list.append(info.rsplit(":")[1])
ls.append(list)
list = []
elif "状态:" in info and "正常" not in info:
list = []
return ls
for u in url:
ls = get_iss(u)
for i in ls:
for j in i:
print j