Skip to content

Instantly share code, notes, and snippets.

@czwen
Last active July 17, 2025 07:25
Show Gist options
  • Save czwen/30747e7319177b63d8936e962bf13209 to your computer and use it in GitHub Desktop.
Save czwen/30747e7319177b63d8936e962bf13209 to your computer and use it in GitHub Desktop.
#!MANAGED-CONFIG
[General]
# --- GENERAL ---
# Enhanced Wi-Fi Assist
wifi-assist = true
# Hybrid Network
all-hybrid = false
# Gaming Optimization
udp-priority = false
# Latency Benchmark
internet-test-url = http://wifi.vivo.com.cn/generate_204
proxy-test-url = http://1.1.1.1/generate_204
test-timeout = 5
# GeoIP Database
geoip-maxmind-url = https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb
ipv6 = false
# --- Wi-Fi ACCESS ---
allow-wifi-access = false
# Surge iOS - 默认 HTTP 端口号:6152,SOCKS5 端口号:6153
wifi-access-http-port = 6152
wifi-access-socks5-port = 6153
# Surge Mac - 默认 HTTP 端口号:6152,SOCKS5 端口号:6153
http-listen = 0.0.0.0
socks5-listen = 0.0.0.0
# 允许热点共享
allow-hotspot-access = true
# --- REMOTE CONTROLLER ---
external-controller-access = [email protected]:6160
# HTTP API & Web Dashboard
# This option allows using HTTP APIs to control
http-api = [email protected]:6166
http-api-tls = false
http-api-web-dashboard = true
# --- COMPATIBILITY ---
compatibility-mode = 0
# 跳过代理
skip-proxy = localhost, *.local, injections.adguard.org, local.adguard.org, captive.apple.com, guzzoni.apple.com, 0.0.0.0/8, 10.0.0.0/8, 17.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.168.0.0/16, 192.88.99.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4, 255.255.255.255/32
exclude-simple-hostnames = true
# --- DNS ---
# The IP addresses of upstream DNS servers
read-etc-hosts = true
use-local-host-item-for-proxy = true
include-all-networks = false
# --- ROUTING ---
include-local-networks = false
loglevel = notify
# --- ADVANCED ---
show-error-page-for-reject = true
always-real-ip = link-ip.nextdns.io, *.msftconnecttest.com, *.msftncsi.com, *.srv.nintendo.net, *.stun.playstation.net, xbox.*.microsoft.com, *.xboxlive.com, *.logon.battlenet.com.cn, *.logon.battle.net, stun.l.google.com
hijack-dns = 8.8.8.8:53, 8.8.4.4:53
force-http-engine-hosts = *.ott.cibntv.net, 123.59.31.1,119.18.193.135, 122.14.246.33, 175.102.178.52, 116.253.24.*, 175.6.26.*, 220.169.153.*
use-default-policy-if-wifi-not-primary = false
udp-policy-not-supported-behaviour = REJECT
ipv6-vif = auto
dns-server = 223.5.5.5
encrypted-dns-follow-outbound-mode = true
encrypted-dns-server = https://223.5.5.5/dns-query
[Proxy Group]
⚙️ NoAuto = select, "📎 Mainland", "🌀 Automatic"
🌀 Automatic = select, "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇯🇵 Japan", "🇸🇬 Singapore", "🇺🇸 United States"
👹 AllServer = select, policy-path=替换成你的订阅链接, update-interval=3600
⚠️ Fallback = fallback, "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇯🇵 Japan", "🇸🇬 Singapore", "🇺🇸 United States", interval=600
🍎 Apple = select, "📎 Mainland", "🇭🇰 Hong Kong", "🇺🇸 United States"
🍻 Bilibili = select, "📎 Mainland", "🇭🇰 Hong Kong", "🇨🇳 Taiwan"
🎬 Disney+ = select, "🇭🇰 Hong Kong", "🇸🇬 Singapore", "🇨🇳 Taiwan"
🎞 Netflix = select, "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇸🇬 Singapore", "🇯🇵 Japan", "🇺🇸 United States"
🕸 Speedtest = select, "📎 Mainland", "🌀 Automatic", "👹 AllServer"
✈️ Telegram = select, "🌀 Automatic", "🇸🇬 Singapore", "🇺🇸 United States", "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇯🇵 Japan"
🎵 TikTok = select, "🇨🇳 Taiwan", "🇸🇬 Singapore", "🇯🇵 Japan", "🇺🇸 United States"
🐦 Twitter = select, "🌀 Automatic", "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇸🇬 Singapore", "🇯🇵 Japan", "🇺🇸 United States"
📺 YouTube = select, "🌀 Automatic", "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇸🇬 Singapore", "🇯🇵 Japan", "🇺🇸 United States"
🤖 AI = select, "🇺🇸 United States", "🇯🇵 Japan", "🇸🇬 Singapore"
♣️ Microsoft = select, "📎 Mainland", "🇭🇰 Hong Kong", "🇸🇬 Singapore", "🇺🇸 United States"
☁️ OneDrive = select, "📎 Mainland", "🇭🇰 Hong Kong", "🇸🇬 Singapore", "🇺🇸 United States"
🌕 WeChat = select, "📎 Mainland", "🇭🇰 Hong Kong", "🇸🇬 Singapore", "🇺🇸 United States"
🇭🇰 Hong Kong = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=港|🇭🇰|香港|HK|Hong
🇨🇳 Taiwan = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=台|🇨🇳|台湾|TW|Tai
🇯🇵 Japan = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=日|🇯🇵|日本|JP|Japan
🇸🇬 Singapore = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=坡|🇸🇬|新加坡|狮城|SG|Singapore
🇺🇸 United States = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=美|🇺🇸|美国|US|States|American
🇬🇧 United Kingdom = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=🇬🇧|英国|英|英格兰|UK|United Kingdom
🇰🇷 Korea = select, include-other-group=👹 AllServer, update-interval=0, policy-regex-filter=韩|韩国|Korea|KR|🇰🇷
📎 Mainland = select, DIRECT
🌍 Proxy = select, "🌀 Automatic", "⚠️ Fallback", "🇭🇰 Hong Kong", "🇨🇳 Taiwan", "🇸🇬 Singapore", "🇯🇵 Japan", "🇺🇸 United States", "🇬🇧 United Kingdom"
[Rule]
IP-CIDR,192.168.168.0/24,DEVICE:MACMINI // gohome
# > Apple Intelligence
DOMAIN-SUFFIX,apple-relay.apple.com,"🤖 AI"
DOMAIN-SUFFIX,apple-relay.cloudflare.com,"🤖 AI"
DOMAIN-KEYWORD,apple-relay,"🤖 AI"
# > TMDB
DOMAIN-SUFFIX,api.themoviedb.org,"🌀 Automatic"
PROCESS-NAME,Spotify*,"🌀 Automatic"
# > SUFFIX
DOMAIN-SUFFIX,nssurge.com,"🌀 Automatic"
# > DOMAIN
DOMAIN,jable.tv,"🌀 Automatic"
# > Adblock4limbo
RULE-SET,https://limbopro.com/Adblock4limbo_surge.list,REJECT
# > ChianDNS
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/ChinaDNS/ChinaDNS.list,DIRECT
# > China
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/China/China.list,DIRECT
# > Github
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/GitHub/GitHub.list,"🌀 Automatic"
# > OneDrive
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/OneDrive/OneDrive.list,"☁️ OneDrive"
# > Facebook
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Facebook/Facebook.list,"🌀 Automatic"
# > Threads
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Threads/Threads.list,"🌀 Automatic"
# > Instagram
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Instagram/Instagram.list,"🌀 Automatic"
# > AppStore
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/AppStore/AppStore.list,DIRECT
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/AppleTV/AppleTV.list,"🍎 Apple"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Apple/Apple.list,"🍎 Apple"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/AppleNews/AppleNews.list,"🇺🇸 United States"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Apple/Apple.list,"🍎 Apple"
# > WeChat
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/WeChat/WeChat.list,"🌕 WeChat"
# > Emby
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Emby/Emby.list,"🌀 Automatic"
# > Discord
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Discord/Discord.list,"🌀 Automatic"
# > Bing
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Bing/Bing.list,"🤖 AI"
# > Tesla
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Tesla/Tesla.list,DIRECT
# > Twitter
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Twitter/Twitter.list,"🐦 Twitter"
# > Safari 防跳转
DOMAIN,app-site-association.cdn-apple.com,REJECT
# > ban UDP on Youtube
AND,((PROTOCOL,UDP), (DOMAIN-SUFFIX,googlevideo.com)),REJECT-NO-DROP
# > ban National Anti-fraud Center
DOMAIN,prpr.96110.cn.com,DIRECT
DOMAIN-KEYWORD,96110,REJECT
DOMAIN-SUFFIX,gjfzpt.cn,REJECT
# > Vercel --> sub-store
RULE-SET,https://raw.githubusercontent.com/getsomecat/GetSomeCats/Surge/rule/substore.list,"🌀 Automatic"
DOMAIN-SUFFIX,vercel.app,"🌀 Automatic"
# > > Direct(Google|Proxy|Download|Spotify)
RULE-SET,https://raw.githubusercontent.com/bunizao/TutuBetterRules/tutu/RuleList/DOMAlN/Direct.list,DIRECT
# > > Mail
DOMAIN-SUFFIX,smtp,DIRECT
URL-REGEX,(Subject|HELO|SMTP),DIRECT
# > > Unbreak 后续规则修正
RULE-SET,https://raw.githubusercontent.com/keelewang/Profiles/main/Surge/Ruleset/Unbreak.list,DIRECT
# > 流媒体
# > Disney+
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Disney/Disney.list,"🎬 Disney+"
# > Netflix
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Netflix/Netflix.list,"🎞 Netflix"
# > TikTok
RULE-SET,https://raw.githubusercontent.com/Semporia/TikTok-Unlock/master/Surge/TikTok.list,"🎵 TikTok"
# > 北美相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_us.conf,"🇺🇸 United States"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_us.conf,"🇺🇸 United States"
# > 欧洲相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_eu.conf,"🇬🇧 United Kingdom"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_eu.conf,"🇬🇧 United Kingdom"
# > 日本相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_jp.conf,"🇯🇵 Japan"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_jp.conf,"🇯🇵 Japan"
# > 韩国相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_kr.conf,"🇰🇷 Korea"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_kr.conf,"🇰🇷 Korea"
# > 香港相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_hk.conf,"🇭🇰 Hong Kong"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_hk.conf,"🇭🇰 Hong Kong"
# > 台湾相关流媒体
RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_tw.conf,"🇨🇳 Taiwan"
RULE-SET,https://ruleset.skk.moe/List/ip/stream_tw.conf,"🇨🇳 Taiwan"
# > 所有流媒体(包括上述所有流媒体)
# RULE-SET,https://ruleset.skk.moe/List/non_ip/stream.conf,"🌀 Automatic"
# RULE-SET,https://ruleset.skk.moe/List/ip/stream.conf,"🌀 Automatic"
# > Bilibili
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/BiliBili/BiliBili.list,"🍻 Bilibili"
# > Speedtest
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Speedtest/Speedtest.list,"🕸 Speedtest"
# > Youtube & Google Search
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/YouTube/YouTube.list,"📺 YouTube"
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/GoogleSearch/GoogleSearch.list,"📺 YouTube"
# > Global 全球加速
RULE-SET,https://raw.githubusercontent.com/keelewang/Profiles/main/Surge/Ruleset/Global.list,"🌀 Automatic"
# > China 中国直连
RULE-SET,https://raw.githubusercontent.com/keelewang/Profiles/main/Surge/Ruleset/China.list,DIRECT
# > Local Area Network 局域网
RULE-SET,LAN,DIRECT
# > ASN China 分流
RULE-SET,https://raw.githubusercontent.com/VirgilClyne/GetSomeFries/main/ruleset/ASN.China.list,DIRECT
# > pikpak
DOMAIN-SUFFIX,mypikpak.com,"🇺🇸 United States" // Added for: api-drive.mypikpak.com:443
# > PayPal
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PayPal/PayPal.list,"🇺🇸 United States"
# > Roit 游戏分流规则
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Riot/Riot.list,"🇺🇸 United States"
# > Test
# > Non IP
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject-drop.conf,REJECT-DROP
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/reject.conf,REJECT-TINYGIF
RULE-SET,https://ruleset.skk.moe/List/non_ip/reject.conf,REJECT
# > IP
RULE-SET,https://ruleset.skk.moe/List/ip/reject.conf,REJECT-DROP
# > 常见静态 CDN
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/cdn.conf,"🌀 Automatic"
RULE-SET,https://ruleset.skk.moe/List/non_ip/cdn.conf,"🌀 Automatic"
# > AI 包含 OpenAI、Bard、Claude、Perplexity 等
DOMAIN-SUFFIX,googleapis.com,"🤖 AI" // Gemini
RULE-SET,https://ruleset.skk.moe/List/non_ip/ai.conf,"🤖 AI"
# > Telegram
RULE-SET,https://ruleset.skk.moe/List/non_ip/telegram.conf,"✈️ Telegram"
RULE-SET,https://ruleset.skk.moe/List/ip/telegram.conf,"✈️ Telegram"
RULE-SET,https://ruleset.skk.moe/List/ip/telegram_asn.conf,"✈️ Telegram"
# > Apple CDN
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/apple_cdn.conf,"🍎 Apple"
# > Apple Service
RULE-SET,https://ruleset.skk.moe/List/non_ip/apple_services.conf,"🍎 Apple"
# > Microsoft CDN
RULE-SET,https://ruleset.skk.moe/List/non_ip/microsoft_cdn.conf,"♣️ Microsoft"
# > Microsoft
RULE-SET,https://ruleset.skk.moe/List/non_ip/microsoft.conf,"♣️ Microsoft"
# > 网易云音乐
RULE-SET,https://ruleset.skk.moe/List/non_ip/neteasemusic.conf,"📎 Mainland"
RULE-SET,https://ruleset.skk.moe/List/ip/neteasemusic.conf,"📎 Mainland"
# > Misc
RULE-SET,https://ruleset.skk.moe/List/non_ip/domestic.conf,"📎 Mainland"
RULE-SET,https://ruleset.skk.moe/List/non_ip/direct.conf,"📎 Mainland"
RULE-SET,https://ruleset.skk.moe/List/non_ip/global_plus.conf,"🌀 Automatic"
RULE-SET,https://ruleset.skk.moe/List/non_ip/global.conf,"🌀 Automatic"
RULE-SET,https://ruleset.skk.moe/List/ip/domestic.conf,"📎 Mainland"
# > 软件更新、操作系统等大文件下载
DOMAIN-SET,https://ruleset.skk.moe/List/domainset/download.conf,"📎 Mainland"
RULE-SET,https://ruleset.skk.moe/List/non_ip/download.conf,"📎 Mainland"
# > 兜底规则
FINAL,⚙️ NoAuto,dns-failed
[Host]
*.taobao.com = server:223.5.5.5
*.tmall.com = server:223.5.5.5
*.alipay.com = server:223.5.5.5
*.alicdn.com = server:223.5.5.5
*.aliyun.com = server:223.5.5.5
*.jd.com = server:119.28.28.28
*.qq.com = server:119.28.28.28
*.tencent.com = server:119.28.28.28
*.weixin.com = server:119.28.28.28
*.bilibili.com = server:119.29.29.29
hdslb.com = server:119.29.29.29
*.163.com = server:119.29.29.29
*.126.com = server:119.29.29.29
*.126.net = server:119.29.29.29
*.127.net = server:119.29.29.29
*.netease.com = server:119.29.29.29
*.mi.com = server:119.29.29.29
*.xiaomi.com = server:119.29.29.29
*testflight.apple.com = server:8.8.4.4
# > Firebase Cloud Messaging
mtalk.google.com = 108.177.125.188
# > Google Dl
dl.google.com = server:119.29.29.29
dl.l.google.com = server:119.29.29.29
update.googleapis.com = server:119.29.29.29
# > Router Admin Panel
amplifi.lan = server:syslib // Ubiquiti Amplifi Router
router.synology.com = server:syslib // Synology Router
sila.razer.com = server:syslib // Razer Sila Router
router.asus.com = server:syslib // Asus Router
routerlogin.net = server:syslib // Netgear Router
orbilogin.com = server:syslib // Netgear Obri Router
www.LinksysSmartWiFi.com = server:syslib // Linksys Router
LinksysSmartWiFi.com = server:syslib // Linksys Router
myrouter.local = server:syslib // Linksys Router
www.miwifi.com = server:syslib // Xiaomi Mi WiFi Router
miwifi.com = server:syslib // Xiaomi Mi WiFi Router
mediarouter.home = server:syslib // Huawei Router
tplogin.cn = server:syslib // TP-Link Router
tplinklogin.net = server:syslib // TP-Link Router
melogin.cn = server:syslib // MERCURY Router
falogin.cn = server:syslib // FAST Router
[URL Rewrite]
# > Redirect Google Search Service
^https?:\/\/(www.)?(g|google)\.cn https://www.google.com 302
# > Redirect Google Maps Service
^https?:\/\/(ditu|maps).google\.cn https://maps.google.com 302
# > Redirect HTTP to HTTPS
^https?:\/\/(www.)?taobao\.com\/ https://taobao.com/ 302
^https?:\/\/(www.)?jd\.com\/ https://www.jd.com/ 302
^https?:\/\/(www.)?mi\.com\/ https://www.mi.com/ 302
^https?:\/\/you\.163\.com\/ https://you.163.com/ 302
^https?:\/\/(www.)?suning\.com\/ https://suning.com/ 302
^https?:\/\/(www.)?yhd\.com\/ https://yhd.com/ 302
# > AbeamTV header
^https?:\/\/api\.abema\.io\/v\d\/ip\/check - reject
# > CUSTOM URL header
[Header Rewrite]
http-request ^https?:\/\/.*\.zhihu\.com\/(question|topic) header-replace User-Agent "osee2unifiedRelease/4432 osee2unifiedReleaseVersion/7.8.0 Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mo bile/15E148"
# 解决github速率限制返回429问题
http-request ^https:\/\/github\.com\/ header-replace Accept-Language en-us
http-request ^https:\/\/(raw|gist)\.githubusercontent\.com\/ header-replace Accept-Language en-us
[MITM]
skip-server-cert-verify = true
tcp-connection = true
h2 = true
hostname = www.google.cn, api.abema.io, *.zhihu.com, -CUSTOMMitM, sub.store, github.com, raw.githubusercontent.com, gist.githubusercontent.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment