Surge 自写✍️配置分享 支持For iOS & Mac

很久之前分享了 自用圈X 配置 有了佬问要surge的配置 现在它来啦
GitHub:GitHub - curtinp118/Surge5: Surge5 自用配置库 🚀 精细分流、节点多样、支持多订阅
支持多机场:airplane:订阅 有建议或问题 可以及时反馈给我 好用的佬可以点点举报

顺便贴一下大佬的喂饭教程:
https://blog.skk.moe/post/i-have-my-unique-surge-setup/
配置:

# Github:https://github.com/curtinp118/Surge5/tree/main
[General]
loglevel = notify
show-error-page-for-reject = true
allow-wifi-access = true
allow-hotspot-access = true
all-hybrid = true
ipv6 = false
ipv6-vif = auto
test-timeout = 2

# 测试 URL
internet-test-url = http://www.apple.com/library/test/success.html
proxy-test-url = http://www.gstatic.com/generate_204

geoip-maxmind-url = https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb
disable-geoip-db-auto-update = false
exclude-simple-hostnames = true

# DNS
dns-server = 223.5.5.5, 119.29.29.29, 8.8.8.8, 1.1.1.1
encrypted-dns-follow-outbound-mode = false
encrypted-dns-server = https://223.5.5.5/dns-query
read-etc-hosts = true

# 控制器
http-api-web-dashboard = true
http-api-tls = true
proxy-restricted-to-lan = false
http-listen = 0.0.0.0
socks5-listen = 0.0.0.0

skip-proxy = 223.5.5.5, 127.0.0.1, 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, 17.0.0.0/8, *.local, *.crashlytics.com, seed-sequoia.siri.apple.com, localhost, sequoia.apple.com, www.abchina.com.cn, captive.apple.com, 169.254.0.0/16, 192.0.0.0/24, 192.0.2.0/24, 192.168.0.0/16

always-real-ip = *.srv.nintendo.net, *.stun.playstation.net, xbox.*.microsoft.com, *.xboxlive.com, *.battlenet.com.cn, *.battlenet.com, *.blzstatic.cn, *.battle.net

udp-policy-not-supported-behaviour = reject
udp-priority = true
always-raw-tcp-hosts = *.baidu.com

[Proxy]
# 自己建节点,比如:
US = vmess, us.example.com, 443, username=xxx, password=xxx, tls=true
JP = trojan, jp.example.com, 443, password=xxx, sni=jp.example.com

[Proxy Group]
# > 策略组(下面的节点信息需与外部节点对应,若删除了外部节点里的节点,那么在策略组里也要删除。)
Proxy = select, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇨🇳 台湾节点", "🇸🇬 新加坡节点",  icon-url=https://raw.githubusercontent.com/Irrucky/Tool/main/Surge/icon/surge_2.png, no-alert=0, hidden=0, include-all-proxies=0
Apple = select, DIRECT, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/Apple.png
OpenAI = select, Proxy, "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点",  icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/chxm1023/ChatGPT5.png, no-alert=0, hidden=0, include-all-proxies=0
Telegram = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/erdongchanyo/Telegram.png
Twitter = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Twitter.png
Netflix = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix.png
Disney = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Disney.png
YouTube = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/youtube.png
Spotify = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/spotify.png
TikTok = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/tiktok.png
PayPal = select, DIRECT, Proxy, "🇺🇸 美国节点", "🇨🇳 台湾节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/lige47/social-paypal.png, no-alert=0, hidden=0, include-all-proxies=0
BiliBili = select, DIRECT, "🇭🇰 香港节点", "🇨🇳 台湾节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/bilibili.png
GlobalMedia = select, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/HKMTMedia.png
Microsoft = select, DIRECT, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Windows_11.png
Gamer = select, DIRECT, Proxy, "🇭🇰 香港节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", icon-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Game.png
🇭🇰 香港节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇭🇰)|(港)|(香港)|(Hong)|(HK), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/Hong_Kong.png
# > 外部节点
🇺🇸 美国节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇺🇸)|(美)|(美国)|(States)|(US), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/United_States.png

🇯🇵 日本节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇯🇵)|(日本)|(Japan)|(JP), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/Japan.png

🇨🇳 台湾节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇨🇳)|(湾)|(台湾)|(Tai)|(TW), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/China.png

🇰🇷 韩国节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇰🇷)|(韩)|(韩国)|(Korea)|(KR), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/South_Korea.png

🇸🇬 新加坡节点 = smart, include-other-group=HUB, update-interval=0, no-alert=0, hidden=1, include-all-proxies=0, policy-regex-filter=(🇸🇬)|(新)|(狮)|(新加坡)|(Singapore)|(SG), icon-url=https://raw.githubusercontent.com/Semporia/Hand-Painted-icon/master/Rounded_Rectangle/Singapore.png

HUB = select, include-other-group="SUB1, SUB2, SUB3", update-interval=0, no-alert=0, hidden=1, include-all-proxies=0
# 机场订阅1
SUB1 = select, policy-path=url1, update-interval=0, no-alert=0, hidden=0, include-all-proxies=0
# 机场订阅2
SUB2 = select, policy-path=url2, update-interval=0, no-alert=0, hidden=0, include-all-proxies=0, icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/meta.png
# 机场订阅3
SUB3 = select, policy-path=url3, update-interval=0, no-alert=0, hidden=0, include-all-proxies=0, icon-url=https://raw.githubusercontent.com/fmz200/wool_scripts/main/icons/apps/meta.png


[Rule]
IP-CIDR,0.0.0.0/32,REJECT,no-resolve
DOMAIN-SET,https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-surge2.txt,REJECT,pre-matching,extended-matching
RULE-SET,https://limbopro.com/Adblock4limbo_surge.list,REJECT

RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Apple/Apple_All_No_Resolve.list,Apple,no-resolve
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/OpenAI/OpenAI.list,OpenAI,no-resolve
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/GitHub/GitHub.list,Proxy
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Microsoft/Microsoft.list,Microsoft
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PayPal/PayPal.list,PayPal

# 游戏
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Epic/Epic.list,Gamer
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Sony/Sony.list,Gamer
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Steam/Steam.list,Gamer
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Nintendo/Nintendo.list,Gamer

# 流媒体
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/Netflix/Netflix.list,Netflix
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Disney/Disney.list,Disney
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Spotify/Spotify.list,Spotify
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/TikTok/TikTok.list,TikTok
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/BiliBili/BiliBili.list,BiliBili

# 媒体
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/ChinaMedia/ChinaMedia.list,DIRECT
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/GlobalMedia/GlobalMedia_All_No_Resolve.list,GlobalMedia

# 社交
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Telegram/Telegram.list,Telegram
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Twitter/Twitter.list,Twitter

# 通用代理规则
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Proxy/Proxy_All_No_Resolve.list,Proxy

# 大陆直连
RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/China/China.list,DIRECT
RULE-SET,LAN,DIRECT

FINAL,Proxy

[URL Rewrite]
^https?://(www.)?g.cn https://www.google.com 302
^https?://(www.)?google.cn https://www.google.com 302

[MITM]
skip-server-cert-verify = true
h2 = true
hostname = *.google.com, *.g.cn, *.google.cn
24 个赞

这就很秀了

1 个赞

啊不是?

1 个赞

哈哈 :smiley:

1 个赞

surge群看到你了:eyes:,话说用加密dns的话这个encrypted-dns-follow-outbound-mode 不改成true吗?

1 个赞

主要追求性能(基本上大多数都是国内外混合用、DNS 分流要求高),保持 false
如果你非常在意隐私(比如全局代理、想避免 DNS 泄漏),就建议改成 true

直接通过链接导入,会提示这边出错

这是示例,例如us.example.comusername=xxx要替换成你自己的节点的

感谢分享

Surge 配置老复杂了,以前在 youtube 搜了一堆教程,都是各玩各的。最后也没折腾明白。 :joy:

回到家软路由全程接管 但是还要用surge的模块怎么配置?

可以删掉 在SUB1 = select, policy-path=url1, url1 替换成你机场链接

好问题 可以脚本切换

感觉surge配置确实稍微复杂一点,用了个别人的改改节点订阅但是感觉日常还是用loon更多

Surge 多网络环境自动切换

有一段时间,我经常需要带着我的笔记本在不同的网络环境下切换,所以我配置了如下的 Proxy 和 Proxy Group、由 Surge 实现自动切换网络:

[Proxy]
# 无线网卡。在 MacBook Pro 上,无线网卡的接口名一定是 en0
Wi-Fi = direct, interface=en0, test-url=http://connectivitycheck.platform.hicloud.com/generate_204
# 需要根据 ifconfig 自己判断。而且,Thunderbolt 自带的网卡 和 通过 Thunderbolt 的 PCIE 转接的网卡 的接口名也不一样
Thunderbolt = direct, interface=en10, test-url=http://connectivitycheck.platform.hicloud.com/generate_204
# 国内测速地址如前文所说,可以按需选择。这里是因为将 direct 作为一个特殊的 Proxy Policy、所以需要手动指定测速地址、否则 Surge 会使用 `proxt-test-url` 来测活

[Proxy Group]
# 新建一个策略组 Domestic,使用 fallback、每 30 秒测活一次
# 这个策略组还同时包含了 Surge 内置的 DIRECT 策略、即由 macOS 系统决定的当前活跃的网络接口(也就是 Surge 的 Primary Interface Changed 中的 Primary Interface)
Domestic = fallback, Thunderbolt, Wi-Fi, DIRECT, interval=30, timeout=3
# 如果策略组使用 load-balance,还可以实现多网卡负载均衡和叠加、适合下载没有限制 IP 的大文件
Domestic Dual = load-balance, Thunderbolt, Wi-Fi, interval=30, timeout=3

其实也还好 loon 用不习惯 :smiling_face_with_tear: 还是 圈x 舒服 可惜开发者摆烂

surge确实需要折腾一番。

:speak_no_evil_monkey: 配置文件里面不能编辑和同步模块,难搞。

我看着好像深港有喵的配置呢。

小白看起来挺复杂