Skip to content

Instantly share code, notes, and snippets.

@Misaka-0x447f
Last active May 18, 2024 19:34
Show Gist options
  • Save Misaka-0x447f/5407a2d1ee135b2e5adbe179d6fa1146 to your computer and use it in GitHub Desktop.
Save Misaka-0x447f/5407a2d1ee135b2e5adbe179d6fa1146 to your computer and use it in GitHub Desktop.
quantumult rules
[general]
server_check_url= http://google.com/generate_204
resource_parser_url= https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/resource-parser.js
;运行模式模块,running_mode_trigger 设置,即根据网络自动切换 分流/直连/全局代理 等模式。
;running-mode-trigger 模式下,跟手动切换直连/全局代理 等效,rewrite/task 模块始终会生效,比 ssid 策略组设置简单,比 ssid-suspend 更灵活。
;running_mode_trigger=filter, filter, asus-5g:all_direct, asus: all_proxy
; 上述写法,前两个 filter 表示 在 4G 网络跟一般 Wi-Fi 下,走 filter(分流)模式,asus-5g 则切换为全局直连,asus 切换为全局代理
; 如需使用,相应 SSID 换成你自己 Wi-Fi 名即可
;ssid_suspended_list,让 Quantumult X 在特定 Wi-Fi 网络下暂停工作(仅 task 模块会继续工作),多个Wi-Fi用“,”连接
;ssid_suspended_list=Asus, Shawn-Wifi
;dns exclusion list中的域名将不使用fake-ip方式. 其它域名则全部采用 fake-ip 及远程解析的模式
;dns_exclusion_list=*.qq.com, qq.com
;UDP名单,留空则默认所有为端口。不在udp白名单列表中的端口,将被丢弃处理。
;udp_whitelist=53, 123, 1900, 80-443
;下列表中的内容将不经过 QuantumultX 的处理
;excluded_routes= 192.168.0.0/16, 172.16.0.0/12, 100.64.0.0/10, 10.0.0.0/8
;icmp_auto_reply=true
[dns]
;指定的 dns服务器
server=223.5.5.5
server=1.1.1.1
server=8.8.8.8
;指定域名解析dns
;server=/*testflight.apple.com/23.76.66.98
;server=8.8.8.8
;server=/example1.com/8.8.4.4
;server=/*.example2.com/223.5.5.5
;server=/example4.com/[2001:4860:4860::8888]:53
;address=/example5.com/192.168.16.18
;address=/example6.com/[2001:8d3:8d3:8d3:8d3:8d3:8d3:8d3]
[task_local]
;任务模块,可用于签到,天气话费查询等
;js文件放于iCloud或者本机的Quantumult X/Scripts 路径下。TF版本可直接使用远程js链接
;从 “分” 开始的5位cron 写法,具体 cron 表达式可自行 Google
;比如上述语句 代表每天 12 点 2 分,自动执行一次;
;tag参数为 task 命名标识;
;img-url参数用于指定 task 的图标(108*108)
#以下为策略组[policy]部分
# static 策略组中,你需要手动选择想要的节点/策略组。
# available 策略组将按顺序选择你列表中第一个可用的节点。
# round-robin 策略组,将按列表的顺序轮流使用其中的节点。
# ssid 策略组,将根据你所设定的网络来自动切换节点/策略组
;img-url 参数用于指定策略组图标,可远程,也可本地/iCloud(Quantumult X/Images路径下) (108*108 大小)
;direct/proxy/reject 则只能用本地图标,名字分别为 direct.png, proxy.png,reject.png 放置于 Images 文件夹下即可生效 (108*108 大小)
[policy]
;static=苹果服务, direct, proxy, img-url= https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Apple.png
static=fallback, direct, proxy, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Global.png
#server-tag-regex 以及 resource-tag-regex 参数用于正则筛选来建立策略组
#具体可参见教程部分: https://shrtm.nu/DAFP
#以下是quantumultX的3普通种策略组类型写法
;static=policy-name-1, Sample-A, Sample-B, Sample-C
;available=policy-name-2, Sample-A, Sample-B, Sample-C
;round-robin=policy-name-3, Sample-A, Sample-B, Sample-C
#下面是ssid策略组示范
;ssid=policy-name-4, Sample-A, Sample-B, LINK_22E171:Sample-B, LINK_22E172:Sample-C
# "tag" 跟 "enabled" 为可选参数,分别表示 “标签”及“开启状态”, true 为开启,false 关闭.
# update-interval 为更新时间参数,单位 秒, 默认更新时间为 24*60*60=86400 秒,也就是24小时.
# opt-parser=true/false 用于控制是否对本订阅 开启资源解析器,不写或者 false 表示不启用解析器;
#服务器远程订阅
[server_remote]
https://api.rixcloud.io/v2/common/service/21829/subscribe/ssr?auth=295ad30d2abeb6eb50230e1441ea348f, tag=rixcloud, update-interval=86400, opt-parser=false, enabled=true
#支持本地/iCloud的节点文件,位于Quantumult X/Profiles路径下
;servers.txt, tag=本地服务器, img-url=https://raw.githubusercontent.com/crossutility/Quantumult-X/master/quantumult-x.png, enabled=false
#规则分流远程订阅
[filter_remote]
#远程分流模块,可使用force-policy来强制使用策略偏好, 替换远程规则内所指定的策略组
;同样的
# update-interval 为更新时间参数,单位 秒, 默认更新时间为 24*60*60=86400 秒,也就是24小时.
# opt-parser=true/false 用于控制是否对本订阅 开启资源解析器,不写或者 false 表示不启用解析器;
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Guard/Advertising.list, tag=adBlock, update-interval=86400, enabled=true
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Guard/Hijacking.list, tag=hijackBlock, enabled=true
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/StreamingMedia/StreamingCN.list, tag=localStreaming, enabled=true
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Global.list, tag=global, enabled=true
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Extra/ChinaIP.list, tag=china, enabled=true
#支持本地/iCloud规则文件,位于Quantumult X/Profiles路径下
;filter.txt, tag=本地分流, enabled=false
#rewrite 复写远程订阅
[rewrite_remote]
https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Rewrite.conf, tag=adblock, update-interval=86400, opt-parser=false, enabled=true
#远程复写模块,内包含主机名hostname以及复写rewrite规则
# update-interval 为更新时间参数,单位 秒, 默认更新时间为 24*60*60=86400 秒,也就是24小时.
# opt-parser=true/false 用于控制是否对本订阅 开启资源解析器,不写或者 false 表示不启用解析器;
;Youtube premium 会员请勿开启此条
https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/YouTube.conf, tag=adblock-youtube, update-interval=86400, opt-parser=false, enabled=true
#支持本地/iCloud的复写规则文件,位于Quantumult X/Profiles路径下
;rewrite.txt, tag=本地复写, opt-parser=false, enabled=false
# 本地服务器部分
[server_local]
# 以下示范都是 ip(域名):端口,
# 比如 vmess-a.203.167.55.4:777 ,实际是 203.167.55.4:777
# 前面的 ss-a,ws-tls这些,只是为了让你快速找到自己节点的类型
# 实际使用时,请不要真的 傻乎乎的 写 vmess-a.203.167.55.4:777 这种。
#shadowsocks以及shadowsocksR类型
;shadowsocks=ss-a.example.com:80, method=chacha20, password=pwd, obfs=http, obfs-host=bing.com, obfs-uri=/resource/file, fast-open=false, udp-relay=false, server_check_url=http://www.apple.com/generate_204, tag=Sample-A
;shadowsocks=ss-b.example.com:80, method=chacha20, password=pwd, obfs=http, obfs-host=bing.com, obfs-uri=/resource/file, fast-open=false, udp-relay=false, tag=Sample-B
;shadowsocks=ss-c.example.com:443, method=chacha20, password=pwd, obfs=tls, obfs-host=bing.com, fast-open=false, udp-relay=false, tag=Sample-C
;shadowsocks=ssr-a.example.com:443, method=chacha20, password=pwd, ssr-protocol=auth_chain_b, ssr-protocol-param=def, obfs=tls1.2_ticket_fastauth, obfs-host=bing.com, tag=Sample-D
;shadowsocks=ws-a.example.com:80, method=aes-128-gcm, password=pwd, obfs=ws, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=Sample-E
;shadowsocks=ws-b.example.com:80, method=aes-128-gcm, password=pwd, obfs=ws, fast-open=false, udp-relay=false, tag=Sample-F
;shadowsocks=ws-tls-a.example.com:443, method=aes-128-gcm, password=pwd, obfs=wss, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=Sample-G
# vmess 类型,ws,wss(ws+tls),over-tls,tcp
; ws 类型
;vmess=ws-c.example.com:80, method=chacha20-ietf-poly1305, password= 23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs-host=ws-c.example.com, obfs=ws, obfs-uri=/ws, fast-open=false, udp-relay=false, tag=Sample-H
; wss(ws+tls) 类型
;vmess=ws-tls-b.example.com:443, method=chacha20-ietf-poly1305, password= 23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs-host=ws-tls-b.example.com, obfs=wss, obfs-uri=/ws, tls-verification=true,fast-open=false, udp-relay=false, tag=Sample-I
; tcp 类型
;vmess=vmess-a.example.com:80, method=aes-128-gcm, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, fast-open=false, udp-relay=false, tag=Sample-J
;vmess=vmess-b.example.com:80, method=none, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, fast-open=false, udp-relay=false, tag=Sample-K
; over-tls 类型
;vmess=vmess-over-tls.example.com:443, method=none, password=23ad6b10-8d1a-40f7-8ad0-e3e35cd32291, obfs-host=vmess-over-tls.example.com, obfs=over-tls, tls-verification=true, fast-open=false, udp-relay=false, tag=Sample-L
; http(s) 类型
;http=http.example.com:80, username=name, password=pwd, fast-open=false, udp-relay=false, tag=http
;http=https.example.com:443, username=name, password=pwd, over-tls=true, tls-verification=true, tls-host=example.com, tls-verification=true, fast-open=false, udp-relay=false, tag=http-tls
; trojan 类型
;trojan=example.com:443, password=pwd, over-tls=true, tls-verification=true, fast-open=false, udp-relay=false, tag=trojan-tls-01
;trojan=192.168.1.1:443, password=pwd, over-tls=true, tls-host=example.com, tls-verification=true, fast-open=false, udp-relay=false, tag=trojan-tls-02
#本地分流规则(对于完全相同的某条规则,本地的将优先生效)
[filter_local]
;user-agent, ?abc*, proxy
;host, www.google.com, proxy
;host-keyword, adsite, reject
;host-suffix, googleapis.com, proxy
ip-cidr, 10.0.0.0/8, direct
ip-cidr, 127.0.0.0/8, direct
ip-cidr, 172.16.0.0/12, direct
ip-cidr, 192.168.0.0/16, direct
ip-cidr, 224.0.0.0/24, direct
# 已采用 ip 池数据,因此注释掉 geoip cn
;geoip, cn, direct
# final rules
final, fallback
#本地复写规则
[rewrite_local]
#以下为证书&主机名部分
[mitm]
;以下模块去掉;才生效
;请自行在 APP 的UI中生成证书 并安装&信任
;skip_validating_cert = false
;force_sni_domain_name = false
;hostname = *.example.com, *.sample.com
;passphrase =
;p12 =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment