TGViewer
Cool Scripts Cool Scripts @cool_scripts · 16.3K subscribers
Post #806 3.3K
Sub-Store 小课堂: 根据 Surge 已解锁的功能输出不同的配置
在最新的 iOS 版本中,为 Surge 的托管配置、外部资源和模块 HTTP 请求,新增了 X-Surge-Unlocked-Features 字段,用于服务器判定 Surge 已解锁的功能以区分返回结果

详见 频道消息

在 Sub-Store 中, 可以创建一个文件, 如图. 根据 Surge 已解锁的功能输出不同的配置

const headers = $options?._req?.headers
const features = (headers?.['x-surge-unlocked-features'] || headers?.['X-Surge-Unlocked-Features'])?.split(/\s*,\s*/)
console.log(features)
// 如果包含某个功能
if (features?.includes('encrypted-dns')) {
// 就修改内容
$content = $content.replace(/a/,'b')
}


🤭 Sub-Store 合集

🥰 #SubStore #Sub-Store #小课堂 #tips #配置 #解锁 #功能 #托管 #脚本
  • ❤ 4
More from @cool_scripts
  1. Sep 27, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.42.0 🌐 前端: 2.34.0 ▎使用 shoutrrr-ts Docker 版也移除了 shoutrrr 二进制 感谢 D…
  2. Sep 26, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.41.1 🌐 前端: 2.34.0 ▎调整 sing-box SSH 密钥逻辑 感谢群友 shica 的反馈 ▎调整 SS UR…
  3. Sep 23, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.41.0 🌐 前端: 2.34.0 ▎📦 sing-box WireGuard/Tailscale 支持一些 sing-box…
  4. Sep 19, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.39.9 🌐 前端: 2.32.2 ▎🎈 Loon 支持 server-dns 用于指定解析节点服务器域名的 DNS Loon…
  5. Sep 12, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.39.6 🌐 前端: 2.32.2 ▎🐿️ Egern 支持转换 ip-version 感谢群友 shica 的反馈 自动转换…
  6. Sep 11, 2026🔗 Sub-Store 更新 ⚙️ 后端: 2.39.4 🌐 前端: 2.32.0 ▎SubCase 1.3 新增通知栏快捷开关 (Quick Settings Tile) 新…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →