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 #配置 #解锁 #功能 #托管 #脚本
在最新的 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 #配置 #解锁 #功能 #托管 #脚本