SpechtLite
简介
配置文件
我使用的是上面配置模板链接中的配置,下载之后把几个配置文件放入~/.SpechtLite
中,修改之后在SpechtLite菜单中点击reload config
,别忘了还要点击Set as system log
设置为系统代理。
- id: adapter1
# 类型为HTTP代理服务器.
type: HTTP
host: http.proxy
port: 3128
auth: true
username: proxy_username
password: proxy_password
- id: adapter2
# 类型为HTTP代理,但是使用SSL进行加密。
type: SHTTP
host: http.proxy.connect.via.https
port: 3128
auth: true
username: proxy_username
password: proxy_password
- id: adapter3
# 类型为shadowsocks服务器。
type: ss
host: http.proxy.connect.via.https
port: 3128
# 当前支持的加密方法有: AES-128-CFB, AES-192-CFB, AES-256-CFB, chacha20, salsa20, rc4-md5
method: AES-128-CFB
password: ss_password
- id: adapter4
type: socks5
host: socks5.server
port: 3128
如果你只想使用其中的shadowsocks配置,请参考adapter3
的host
处填写服务器ip、port
处填写端口、method
参考注释填写加密方法、password
处填写ss密码,然后把其他三个adapter项删掉,其他代理方法同理,下面的speed
测速项也要对应修改有的adapter
项。
rule:
- type: iplist
# 被污染的 host IP 地址
file: ~/.SpechtLite/pollutedip
# 我们要使用的adapter的id。
adapter: proxy
- type: list
# 直接连接给定的list文件中的正则表达式匹配域名信息(不包括IP)。
file: ~/.SpechtLite/directlist
adapter: direct
- type: iplist
# 直接连接基于给定的list文件中的ip范围。
file: ~/.SpechtLite/directiprange
adapter: direct
- type: list
# 代理连接给定的list文件中的正则表达式匹配域名信息(不包括IP)。
file: ~/.SpechtLite/proxylist
adapter: proxy
- type: iplist
# 连接基于给定的list文件中的ip范围。
file: ~/.SpechtLite/proxyiprange
adapter: proxy
- type: list
# 拒绝连接给定的list文件中的正则表达式匹配域名信息(不包括IP)。
file: ~/.SpechtLite/rejectlist
adapter: reject
- type: iplist
# 拒绝连接基于给定的list文件中的ip范围。
file: ~/.SpechtLite/rejectiprange
adapter: reject
- type: country
# ISO 国家代码
# 基于目标服务器的国家信息
country: CN
# 这条规则是否匹配到符合这个国家的IP信息。
match: true
adapter: direct
- type: country
# 当无法找到对应IP的地理位置信息时会返回“--”,这通常意味着这是一个内网IP。
country: --
match: true
adapter: direct
- type: DNSFail
# 当DNS解析失败时匹配。
adapter: proxy
- type: all
# 匹配所有的请求,建议为direct,需要走代理的网站写在proxylist中。
adapter: proxy
要修改规则的话可以直接去上面的路径修改,例如要走代理的域名按照下面正则的方式添加到~/.SpechtLite/proxylist
。
list
规则中的file
是一组正则表达式,例如:
你也可以一个ss服务器一个项,这样就很像Surge for Mac了。
Chrome
Chrome 需要安装 SwitchOmega 插件后选择系统代理使用。
吐槽
还有这个应用的Log文件不太准,一开始配置的时候就被坑了...像上图应该是ShadowsocksAdapter
的这里却显示DirectAdapter
,但是直连的话我是看不了Youtube的,真是迷呀。
iTerm 2
在~/.zshrc
中加入下面代码
# where proxy
proxy () {
export http_proxy="http://127.0.0.1:1086" # http代理地址
export https_proxy="http://127.0.0.1:1086" # https代理地址
echo "HTTP Proxy on"
}
# where noproxy
noproxy () {
unset http_proxy
unset https_proxy
echo "HTTP Proxy off"
}
加入后source ~/.zshrc
就能使用了。
如果是终端.app的话需要自己复制export语句来使用代理。