# DivineEngine Quantumult 配置示例 # # 以 ";" 或 "#" 或 "//" 开头的行为注释行。 # # 最新完整的示例需查看 Quantumult X 里「配置文件」中的「示例」 # [general] # 建议在「其他设置」里「GeoLite2」的「来源」填写使用「 https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb 」并开启「自动更新」 ;profile_img_url=http://www.example.com/example.png # resource_parser_url 示例可以在以下网站找到 https://raw.githubusercontent.com/crossutility/Quantumult-X/master/resource-parser.js resource_parser_url=https://cdn.jsdelivr.net/gh/KOP-XIAO/QuantumultX@master/Scripts/resource-parser.js ;geo_location_checker=http://www.example.com/json/, https://www.example.com/script.js # Quantumult 使用 HEAD 方法将 HTTP 请求发送到服务器检查 url 来测试代理的状态,结果应该是两个延迟,第一个是 TCP 与代理服务器的握手,第二个是 Quantumult 成功地从服务器检查 url 接收 HTTP 响应的总时间。闪电图标表示 TCP Fast Open 成功。如果 [server_local] 或 [server_remote] 中的服务器有自己的 server_check_url,则会用自己的 server_check_url 代替 [general] 中的 server_check_url。 # Quantumult 使用 HTTP HEAD 方法对测试网址 server_check_url 进行网页响应性测试(测试结果为通过该节点访问此网页获得 HTTP 响应所需要的时间),来确认节点的可用性。 # Quantumult 界面中的延迟测试方式均为网页响应性测试,显示的最终延迟均为通过对应节点访问测试网页获得 HTTP 响应所需要时间。 # 由于 Trojan 协议为无响应校验协议,使得 HTTP 检测方式即使获得了 HTTP 响应,也不代表节点一定可用。 server_check_url=http://cp.cloudflare.com/generate_204 # DNS 排除列表 # dns_exclusion_list 包含了禁用占位符 IP (240.*) 的域,不在 dns_exclusion_list 中的域都启用了占位符 IP,并打开了 resolve-on-remote 设置。 dns_exclusion_list=*.cmpassport.com, *.jegotrip.com.cn, *.icitymobile.mobi, id6.me # Quantumult 将不会处理到 excluded_routes 的流量。修改后最好重新启动您的设备。 ;excluded_routes=192.168.0.0/16, 172.16.0.0/12, 100.64.0.0/10, 10.0.0.0/8 # Hearthstone: 24.105.30.129/32, 185.60.112.157/32, 185.60.112.158/32, 182.162.132.1/32 excluded_routes=239.255.255.250/32 # 在网络环境切换时出发运行模式变更 # filter - 规则分流,all_proxy - 全部代理,all_direct - 全部直连 # 示例意思:[蜂窝数据],[Wi-Fi],[SSID] # 下列示例的意思为:在蜂窝数据使用规则分流(第一个 filter),在 Wi-Fi 使用规则分流(第二个 filter),在 SSID 为 LINK_22E171 的 Wi-Fi 使用全部代理,,在 SSID 为 LINK_22E172 的 Wi-Fi 使用全部直连 # Rewrite 及 Task 模块始终生效 ;running_mode_trigger=filter, filter, LINK_22E171:all_proxy, LINK_22E172:all_direct # 在特定 SSID 网络时(除了 Task 模块)暂停 Quantumult X ;ssid_suspended_list=LINK_22E174, LINK_22E175 # 参数 udp_whitelist 从 IP 层控制 UDP 数据是否需要舍弃;如舍弃,则该 UDP 请求不会进入规则模块以及策略模块,TCP/UDP 请求记录中也不会有相应的条目,但仍可在日志中查询到相关信息(日志等级 debug)。 # 该参数控制的是流入 Quantumult X Tunnel 的请求,并非 Quantumult X Tunnel 发出的请求,即不会作用于节点所使用的 UDP 目标端口。 ;udp_whitelist=53, 123, 1900, 80-443 udp_whitelist=1-442, 444-65535 # 说明:参数 fallback_udp_policy 的值仅支持末端策略(末端策略为经由规则模块和策略模块后所命中的策略,例如:direct、reject 以及节点;不支持内置策略 proxy 以及其它自定义策略)。默认为 reject。 # 当 UDP 请求经过规则模块以及策略模块后所命中的节点为 Quantumult X 所不支持 UDP 转发的节点(如:VMess、trojan),或支持 UDP 转发但未注明 udp-relay=true 的(例如:SS/SSR 且与服务器是否真实开启 UDP 转发无关),则 fallback_udp_policy 会被使用。 # 注意:如果您需要调整该参数的值为 direct,请务必清楚了解同一目标主机名 TCP 请求与 UDP 请求的源地址不同所造成的隐私及安全风险。 # 如果没有节点支持 UDP 转发,可取消下条注释(去除 ;) ;fallback_udp_policy=direct ;icmp_auto_reply=true [dns] # 查询结果只用于评估过滤器或通过直接策略连接,当通过服务器连接时,查询结果不会被使用,Quantumult 永远不会知道相关域名的目标 IP。 # 如果您想让某个域名(例如:example.com)为 127.0.0.0.1,只需在「filter_local」部分添加「host, example.com, reject」即可。拒绝操作将返回 127.0.0.0.1 的 DNS 响应。 # 禁用系统 DNS # 为了提高性能,会使用从当前网络(系统)中获取的 DNS 服务器(您可以使用「no-system」禁用此功能,但至少要增加一个自定义的 DNS 服务器。 ;no-system # 禁用 IPv6 # 当设置「no-ipv6」时,Quanumult X Tunnel 的 DNS 模块会直接让 AAAA 查询失败。 no-ipv6 # 自定义 DNS # > OneDNS ;server=117.50.10.10 # > DNSPod Public DNS server=119.29.29.29 # > Alibaba Public DNS ;server=223.5.5.5 # 在特定的网络环境下忽略自定义 DNS 可在后方加上「excluded_ssids」相关字段。 # 注意:如配置了 no-system,则请务必确保在忽略了部分自定义 DNS 的配置下至少有一个可用的自定义 DNS 配置。 # server=114.114.114.114, excluded_ssids=SSID1, SSID2 # DNS over HTTPS # 当 DoH 服务器被设置时,所有其他普通的(没有与之相关的特定域)服务器将被忽略。 # 当设置了多个 DoH 服务器时,只有第一个会被使用。 # 当使用的 DoH 服务器不是基于 HTTP/2 时,DoH 将被暂时禁用,并使用常规服务器,直到下次启动 VPN 连接。 # 不建议在与防火墙相关的网络环境中使用,不确定 DoH 服务器是否总能被到达。 # 如果 DoH 服务器在您的国家或地区不是流行的 DNS 服务器,则不推荐使用,它可能会丢失 ISP DNS 服务器返回的 CDN 优化结果。 # 如果 DoH 服务器是一个反广告相关的服务器,则不推荐使用(Quantumult X 过滤模块对于被拒绝的域具有更好的性能,它可以避免客户端无休止的请求)。 ;doh-server=https://dns.alidns.com/dns-query ;doh-server=https://223.6.6.6/dns-query # 本地 DNS 映射 # > Firebase Cloud Messaging address=/mtalk.google.com/108.177.125.188 # > Google Dl server=/dl.google.com/119.29.29.29 server=/dl.l.google.com/119.29.29.29 server=/update.googleapis.com/119.29.29.29 # > PlayStation server=/*.dl.playstation.net/119.29.29.29 # > Router Admin Panel server=/amplifi.lan/system server=/router.synology.com/system server=/sila.razer.com/system server=/router.asus.com/system server=/routerlogin.net/system server=/orbilogin.com/system server=/www.LinksysSmartWiFi.com/system server=/LinksysSmartWiFi.com/system server=/myrouter.local/system server=/www.miwifi.com/system server=/miwifi.com/system server=/mediarouter.home/system server=/tplogin.cn/system server=/tplinklogin.net/system server=/melogin.cn/system server=/falogin.cn/system ;server=8.8.4.4:53 ;server=/example0.com/system ;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] [policy] # # 需要策略图标的在策略后加上:img-url=http://example.com/icon.png # # 类型:静态(static) # 指向您手动选择的候选服务器。 ;static=policy-name-1, Sample-A, Sample-B, Sample-C, img-url=http://example.com/icon.png # 类型:可用(available) # 指向候选服务器的第一个可用服务器(当策略被触发且策略结果不可用时,将立即启动并发 url 延迟测试。 # 如果当时没有网络请求接受策略,这意味着策略处于空闲状态,即使服务器关闭,测试也不会启动。那时,您可以通过手动启动测试来更新服务器状态,但是这没有任何意义)。 ;available=policy-name-2, Sample-A, Sample-B, Sample-C # 类型:负载均衡(round-robin) # 指向在候选服务器中指向下一个服务器以进行下一次连接。 ;round-robin=policy-name-3, Sample-A, Sample-B, Sample-C # 类型:延迟测试(url-latency-benchmark) # 策略指向具有最佳 URL 延迟(公差,单位毫秒)结果的服务器。 # 当用户在 Quantumult X 中手动启动 URL 测试时,策略结果也会被更新。 # 该类型的策略有一个名为 check-interval(秒) 的参数,如果此策略已经被任何请求激活,则将考虑该间隔。 ;url-latency-benchmark=policy-name-8, resource-tag-regex=^sample, server-tag-regex=^example, check-interval=600, tolerance=0 # SSID # 策略根据网络环境的不同指向服务器。 ;ssid=policy-name-4, Sample-A, Sample-B, LINK_22E171:Sample-B, LINK_22E172:Sample-C # resource-tag-regex 及 server-tag-regex 仅适用于 static、available 和 round-robin 类型的策略。 ;static=policy-name-5, resource-tag-regex=^sample, server-tag-regex=^example, img-url=http://example.com/icon.png ;available=policy-name-6, resource-tag-regex=^sample, server-tag-regex=^example ;round-robin=policy-name-7, resource-tag-regex=^sample, server-tag-regex=^example static=Final, proxy, direct, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Final.png static=Streaming, proxy, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Streaming.png static=StreamingSE, direct, proxy, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/StreamingSE.png [server_remote] # # 参数「tag」和「enabled」是可选的。 # 各种远程资源的默认同步时间间隔是 172800 秒。 # 你可以设置 update-interval=172800 来自定义你的自动同步时间间隔(秒),负数表示禁用自动同步。 # [filter_remote] # # 参数「tag」、「force-policy」和「enabled」是可选的。 # 当有强制策略时,远程资源的过滤器中的策略将被忽略,并使用强制策略。 # # Block OTA update for iOS https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Module/Block/SoftwareUpdate.sgmodule, tag=⛔️Block OTA Update(iOS), force-policy=reject, update-interval=172800, opt-parser=true, enabled=false # Unbreak 后续规则修正 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Unbreak.list, tag=🔂Unbreak, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true # Advertising 广告 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/Advertising.list, tag=🛡Advertising, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/AdvertisingPlus.list#type=domain-set, tag=🛡Advertising+, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true # Privacy 隐私 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/Privacy.list, tag=🛡️Privacy, force-policy=reject, update-interval=172800, opt-parser=true, enabled=false # Hijacking 运营商劫持或恶意网站 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/Hijacking.list, tag=🛡️Hijacking, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true # Disney+ https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Video/DisneyPlus.list, tag=🎞Disney+, force-policy=Disney+, update-interval=172800, opt-parser=true, enabled=false # Netflix https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Video/Netflix.list, tag=🎞Netflix, force-policy=Netflix, update-interval=172800, opt-parser=true, enabled=false # YouTube https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Video/YouTube.list, tag=🎞YouTube, force-policy=YouTube, update-interval=172800, opt-parser=true, enabled=false # Spotify https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Music/Spotify.list, tag=💽Spotify, force-policy=Spotify, update-interval=172800, opt-parser=true, enabled=false # Streaming 国际流媒体服务 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Streaming.list, tag=🎞Streaming, force-policy=Streaming, update-interval=172800, opt-parser=true, enabled=true # StreamingSE 中国流媒体服务(面向海外版本) https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/StreamingSE.list, tag=🎞StreamingSE, force-policy=StreamingSE, update-interval=172800, opt-parser=true, enabled=true # Telegram https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Extra/Telegram/Telegram.list, tag=📨Telegram, force-policy=Telegram, update-interval=172800, opt-parser=true, enabled=false # Global 全球加速 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Global.list, tag=🇺🇳Global, force-policy=proxy, update-interval=172800, opt-parser=true, enabled=true # Apple 服务 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Extra/Apple/Apple.list, tag=Apple, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true # China 中国直连 https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/China.list, tag=🇨🇳China, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true [rewrite_remote] # # 参数「tag」和「enabled」是可选的。 # # General https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/General.conf, tag=🔀General, update-interval=172800, enabled=true # Block OTA update for iPadOS, Requires "⛔️Block OTA Update(iOS)" filter https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Module/Block/SoftwareUpdate.sgmodule, tag=⛔️Block OTA Update(iPadOS), update-interval=172800, opt-parser=true, enabled=false # Block Advertising https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/Block/Advertising.conf, tag=🛡Block Advertising, update-interval=172800, enabled=true # Block Advertising+ https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/Block/AdvertisingPlus.conf, tag=🛡Block Advertising+, update-interval=172800, enabled=true # Block YouTube Ads https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/Block/YouTubeAds.conf, tag=🛡Block YouTube Ads, update-interval=172800, enabled=false # Block Aweme Ads https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/Block/AwemeAds.conf, tag=🛡Block Aweme Ads(<= 16.2.0), update-interval=172800, enabled=false [server_local] # # 只有 obfs=http, obfs=ws, obfs=ws, obfs=wss 可以有可选的「obfs-uri」字段。 # wss 中的 obfs-host 参数将用于 TLS 握手和 HTTP 头主机字段,如果没有为 wss 设置 obfs-host,则将使用服务器地址。 # 目前不支持 VMess 和 Trojan 的 UDP relay。 # 当使用 obfs=ws 和 obfs=wss 时,服务器端可以通过带有 mux=0 的 v2ray-plugin 或 v2ray-core 进行部署。 # obfs plugin tls1.2 ticket auth 比 tls1.2 ticket fastauth 和 obfs tls 多一个 RTT,你最好使用 tls1.2 ticket fastauth。 # chacha20-ietf-poly1305 和 chacha20-poly1305 在 VMess 配置中具有相同的效果。 # # 可选字段 tls13 仅用于:shadowsocks obfs=wss / vmess obfs=over-tls and obfs=wss / http over-tls=true / trojan over-tls=true # [server_local] 完整示例请查看「示例」 [filter_local] # Local Area Network 局域网 host-suffix, local, direct ip-cidr, 192.168.0.0/16, direct ip-cidr, 10.0.0.0/8, direct ip-cidr, 172.16.0.0/12, direct ip-cidr, 127.0.0.0/8, direct ip-cidr, 100.64.0.0/10, direct ip-cidr, 224.0.0.0/4, direct ip6-cidr, fe80::/10, direct final, Final [rewrite_local] # [rewrite_local] 完整示例请查看「示例」 [task_local] # # $task.fetch() 组成一个 HTTP 请求并处理响应,只支持 text body。如果您想要 serial requests 而不是 current requests,可以将 $task.fetch() 嵌入到另一个 $task.fetch() 的完成处理程序中。 # # 脚本应保存在本地「我的 iPhone - Quantumult X - Scripts」或「iCloud Drive - Quantumult X - Scripts」中。示例:https://github.com/crossutility/Quantumult-X/blob/master/sample-task.js # # 默认的 HTTP 请求超时是 10 秒。 # # 支持 5 或 6 个 cron 字段,不包括命令字段。 # # [task_local] 完整示例请查看「示例」 event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/streaming-ui-check.js, tag=📺流媒体服务查询, img-url=checkmark.seal.system, enabled=true [http_backend] # # 部署一个本地 HTTP 服务器,并使用 JavaScript 进行数据处理。 # 输入变量为:$reqeust.url、$reqeust.path、$reqeust.headers、$reqeust.body。 # 使用 $done 输出像 $done({status:"HTTP/1.1 200 OK"}, headers:{}, body:"here is a string") 这样的返回响应。 # 此外,您还可以使用签名或任何其他验证方法来验证请求是否合法。 # 部署后您应该通过 http://127.0.0.1:9999/your-path/your-api/. 进行访问。服务器默认监听端口为 9999,您可以在UI中进行更改。 # # [http_backend] 完整示例请查看「示例」 [mitm] # # 只有「hostname」中的 TLS SNI 或目标地址将被 MitM 处理。 # # 默认情况下,当为 HTTPS 请求启用 MitM 时,Quantumult X 会从原站点获取证书(证书会被缓存),保留大部分需要的原始证书信息,并使用 MitM 的 root CA 重新签名,这是推荐的(也是比较兼容的)MitM 证书创建方式。 # # 偶尔有些用户喜欢调试 HTTPS 请求,其域名不存在,所以原证书根本不存在。当参数 simple_cert_hostname 出现的时候。其 TLS SNI 名称在 simple_cert_hostname(及 hostname) 中的 HTTPS 请求将使用纯本地生成的 MitM 证书。 # # 注意!!!您应该始终保护您的 CA 密码和 p12 的私密性。 # ;passphrase = ;p12 = skip_validating_cert = true ;force_sni_domain_name = false ;simple_cert_hostname = non-existed-domain.com, *.non-connected-domain.com ;hostname = *.googlevideo.com