[General]
# > 日志级别与错误显示
loglevel = notify
show-error-page-for-reject = true
# > 访问控制
allow-wifi-access = false
allow-hotspot-access = false
# > 混合网络并发
all-hybrid = false
# > 测试超时
test-timeout = 5
# > 连通性测试 URL
internet-test-url = http://connectivitycheck.platform.hicloud.com/generate_204
proxy-test-url = http://connectivitycheck.gstatic.com/generate_204
# > DNS 设置
# 移除 system,避免混入运营商 DNS 造成解析污染/不稳定
dns-server = 223.5.5.5, 119.29.29.29
# 补充劫持国内常见硬编码 DNS(114 DNS / 阿里云 DNS),防止 App 绕过 Surge DNS 策略
hijack-dns = 8.8.8.8:53, 8.8.4.4:53, 114.114.114.114:53, 223.5.5.5:53
read-etc-hosts = true
exclude-simple-hostnames = true
# > IPv6
ipv6 = false
ipv6-vif = off
# > iOS 路由与流量接管
# 以下三个细分开关仅在 include-all-networks = true 时生效;当前全部关闭以保持兼容性
include-local-networks = false
include-apns = false
include-cellular-services = false
include-all-networks = false
# 节点不支持 UDP 时走直连,优先保证语音、游戏、QUIC 等场景不断流;若更重视防泄露,可改为 REJECT
udp-policy-not-supported-behaviour = DIRECT
# > Surge Mac HTTP/SOCKS5 监听
# 仅监听本机;iOS 的局域网访问由 allow-wifi-access / allow-hotspot-access 控制
http-listen = 127.0.0.1:6152
socks5-listen = 127.0.0.1:6153
# > Web Dashboard
http-api-web-dashboard = false
# > 跳过代理列表
skip-proxy = 127.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, 169.254.0.0/16, 162.14.0.0/16, 211.99.96.0/19, 162.159.192.0/24, 162.159.193.0/24, 162.159.195.0/24, 17.0.0.0/8, 224.0.0.0/4, 255.255.255.255, fc00::/7, fe80::/10, ::1, ::/128, localhost, *.local, captive.apple.com
# > 真实 IP 映射
always-real-ip = *.msftncsi.com, *.msftconnecttest.com, *.srv.nintendo.net, *.stun.playstation.net, xbox.*.microsoft.com, *.xboxlive.com, *.battlenet.com.cn, *.battlenet.com, *.blzstatic.cn, *.battle.net, *.turn.twilio.com, *.stun.twilio.com, stun.syncthing.net, stun.*, 127.*.*.*.sslip.io, 127-*-*-*.sslip.io, *.127.*.*.*.sslip.io, *-127-*-*-*.sslip.io, 127.*.*.*.nip.io, 127-*-*-*.nip.io, *.127.*.*.*.nip.io, *-127-*-*-*.nip.io
# > GeoIP 数据库
geoip-maxmind-url = https://github.com/Hackl0us/GeoIP2-CN/raw/release/Country.mmdb
disable-geoip-db-auto-update = false
[Proxy]
# ------------------------------------------------------------
# 在此处填入你自己的节点。
# 示例(请替换为你自己的服务器信息,协议不限于 snell):
# 🇺🇸US-Example = snell, 1.2.3.4, 12345, psk=your_psk_here, version=5, reuse=true, tfo=true
# 🇯🇵JP-Example = snell, 5.6.7.8, 23456, psk=your_psk_here, version=5, reuse=true, tfo=true, shadow-tls-password=xxx, shadow-tls-sni=www.microsoft.com, shadow-tls-version=3
# 🇭🇰HK-Example = snell, 9.10.11.12, 34567, psk=your_psk_here, version=5, reuse=true, tfo=true
# ------------------------------------------------------------
[Proxy Group]
# > 核心策略
节点选择 = select, 自动选择, 自建节点, 订阅节点, DIRECT, icon-url=https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/icon/02ProxySoftLogo/Surge(1).png
自动选择 = smart, include-other-group="订阅节点,自建节点", url=http://connectivitycheck.gstatic.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Auto.png
# 自建节点:请在 [Proxy] 中添加你自己的节点后,把节点名称填入下面这一行
自建节点 = select, DIRECT, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Daily.png
# 订阅节点:将 policy-path 替换为你自己的订阅链接
订阅节点 = select, policy-path=https://your-subscription-url-here, policy-regex-filter=(?i)^(?!(?:剩余流量|套餐到期)[:]).+, update-interval=86400, icon-url=EMOJI::🥬
# > PT 专用分组(建议至少配置一个海外落地节点用于 PT 场景)
PT专用 = select, 自建节点, 订阅节点, no-alert=1, icon-url=https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/icon/05icon/NAS(2).png
# > 精简业务分流
AI服务 = select, 美国节点, 新加坡节点, 日本节点, 节点选择, DIRECT, icon-url=https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/icon/04ProxySoft/chatgpt(white1).png
国外服务 = select, 节点选择, 香港节点, 美国节点, 新加坡节点, 日本节点, DIRECT, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_Nations.png
流媒体 = select, 香港节点, 美国节点, 新加坡节点, 日本节点, 节点选择, icon-url=https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Conf/icon/GlobalMedia.png
电报信息 = select, 新加坡节点, 香港节点, 节点选择, icon-url=https://raw.githubusercontent.com/lige47/QuanX-icon-rule/main/icon/04ProxySoft/telegram(blue1).png
苹果微软 = select, DIRECT, 节点选择, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Apple.png
# > 地区自动筛选
# 测速 URL 按地区分散到两个不同的探测端点,避免单一探测地址异常时影响所有分组评分
香港节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇭🇰|香港|Hong(?:[\s_-]*Kong)?|(?:^|[-_/|\s])HK(?:G)?(?:[-_/|\s]|$)), url=http://connectivitycheck.gstatic.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Hong_Kong.png
美国节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇺🇸|美国|美國|United[\s_-]*States|(?:^|[-_/|\s])US(?:A)?(?:[-_/|\s]|$)), url=http://cp.cloudflare.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_States.png
日本节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇯🇵|日本|Japan|(?:^|[-_/|\s])JP(?:N)?(?:[-_/|\s]|$)), url=http://connectivitycheck.gstatic.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Japan.png
新加坡节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇸🇬|新加坡|Singapore|(?:^|[-_/|\s])SG(?:P)?(?:[-_/|\s]|$)), url=http://cp.cloudflare.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Singapore.png
韩国节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇰🇷|韩国|韓國|한국|Korea|(?:^|[-_/|\s])KR(?:[-_/|\s]|$)), url=http://connectivitycheck.gstatic.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Korea.png
德国节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇩🇪|德国|德國|Germany|Deutschland|(?:^|[-_/|\s])DE(?:U)?(?:[-_/|\s]|$)), url=http://cp.cloudflare.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Germany.png
英国节点 = smart, include-other-group="订阅节点,自建节点", policy-regex-filter=(?i)(?:^🇬🇧|英国|英國|United[\s_-]*Kingdom|Britain|(?:^|[-_/|\s])(?:UK|GB|GBR)(?:[-_/|\s]|$)), url=http://cp.cloudflare.com/generate_204, interval=600, timeout=5, tolerance=50, icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_Kingdom.png
[Rule]
# ============================================================
# 优先级:
# ① PT 统一走 PT专用分组(最高,防 DNS 泄露,可故障切换)
# ② 微信强制直连(聊天、图片、头像、小程序)
# ③ LAN 直连
# ④ NTP 时间服务器直连(Shadow-TLS 时钟同步关键)
# ⑤ 安全拦截(Firewall + 广告)
# ⑥ 精简分流(AI / YouTube / Netflix / 电报 / 平台)
# ⑦ 国内直连
# ⑧ 兜底代理
# ============================================================
# > 1. PT 站点统一走 PT专用分组(最高优先级,no-resolve 防 DNS 泄露)
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PrivateTracker/PrivateTracker.list,PT专用,"update-interval=86400",no-resolve
# > 2. 微信强制直连(优先于广告、国外代理及国内大规则集)
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/WeChat/WeChat.list,DIRECT,extended-matching,"update-interval=86400",no-resolve
# 微信图片/头像/CDN 兜底:远程 WeChat 规则未覆盖这两个域名
DOMAIN-SUFFIX,gtimg.cn,DIRECT,extended-matching
DOMAIN-SUFFIX,myqcloud.com,DIRECT,extended-matching
# > 3. LAN 直连
RULE-SET,LAN,DIRECT
# > 4. NTP 时间服务器直连
DOMAIN,time.apple.com,DIRECT
DOMAIN,time.windows.com,DIRECT
DOMAIN,time.nist.gov,DIRECT
DOMAIN,ntp.aliyun.com,DIRECT
DOMAIN,cn.pool.ntp.org,DIRECT
DOMAIN,pool.ntp.org,DIRECT
# > 5. Aegis Firewall 安全拦截(高优)
RULE-SET,https://raw.githubusercontent.com/Thoseyearsbrian/Aegis/main/rules/Malware_IOC_Block.list,REJECT,"update-interval=86400",no-resolve
RULE-SET,https://raw.githubusercontent.com/Thoseyearsbrian/Aegis/main/rules/Phishing_Block.list,REJECT,"update-interval=86400",no-resolve
# > 6. 广告拦截
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/reject.conf,REJECT,extended-matching,"update-interval=86400"
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject.conf,REJECT,extended-matching,"update-interval=86400"
# > 7. 精简分流
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/AIGC.list,AI服务,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/YouTube/YouTube.list,流媒体,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Netflix/Netflix.list,流媒体,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Telegram/Telegram.list,电报信息,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/TelegramASN.list,电报信息,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/Apple.list,苹果微软,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/Microsoft.list,苹果微软,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/Google.list,国外服务,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Thoseyearsbrian/Aegis/main/rules/GitHub.list,国外服务,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Thoseyearsbrian/Aegis/main/rules/Proxy.list,国外服务,"update-interval=86400"
# > 8. 国内直连兜底(放在专项代理规则之后)
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/China.list,DIRECT,"update-interval=86400"
RULE-SET,https://raw.githubusercontent.com/Rabbit-Spec/Surge/Master/Rules/ChinaCIDR.list,DIRECT,"update-interval=86400",no-resolve
GEOIP,CN,DIRECT
# > 9. 兜底
FINAL,节点选择,dns-failed
[Host]
# > 阿里 DNS 加速
dns.alidns.com = 223.5.5.5
# > NTP 时间服务器使用 system 解析
time.apple.com = server:system
time.windows.com = server:system
time.nist.gov = server:system
ntp.aliyun.com = server:system
cn.pool.ntp.org = server:system
pool.ntp.org = server:system