Ubuntu配置Shadownsocks以及配置pac规则
周末没事将自己闲置的Thinkpad安装了最新的Ubuntu18.10版本,安装成功之后就想着将之前在自己的vps上配置的shadowsock服务使用上。
第一步安装shadowsocks
1 | sudo apt-get install shadowsocks |
第二步配置shadowsocks
安装完成之后默认的配置文件在/etc/shadowsocks/local.json
,去将里面的配置修改成自己的即可。
1 | { |
第三步启动shadowsocks
1 | sudo sslocal -c /etc/shadowsocks/local.json -d start |
第四步配置pac规则
1. 安装GenPac
1 | sudo pip install genpac |
2. 新建pac配置存放目录
用来存放用户自定义规则列表文件user-rules.txt和生成后的autoproxy.pac文件,例如我的放在home目录下
1 | mkdir ~/soft/pac |
3. 生成autoproxy.pac文件
我使用的是github上托管的这份文件:https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
执行一下命令来创建autoprox.pac
1 | genpac --pac-proxy "SOCKS5 127.0.0.1:1080" --output="autoproxy.pac" --gfwlist-url="https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt" --user-rule-from="user-rules.txt" |
4. 配置系统代理
去Ubuntu设置 -> 网络 -> 代理设置
设置代理,选择自动
,配置url填写你本地的文件路径,例如:file:///home/xxx/soft/pac/autoproxy.pac
Ubuntu配置Shadownsocks以及配置pac规则
http://www.mspring.org/2018/11/17/Ubuntu配置Shadownsocks以及配置pac规则/