mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 04:18:59 +08:00
feat: Clash 节点支持 fingerprint(内部转为 tls-fingerprint); 支持 Clash 配置文件中的 global-client-fingerprint 优先级低于 proxy 内的 client-fingerprint
This commit is contained in:
parent
779950ab11
commit
b80d7f5875
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.179",
|
||||
"version": "2.14.181",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -578,6 +578,10 @@ function Clash_All() {
|
||||
}
|
||||
}
|
||||
|
||||
if (proxy.fingerprint) {
|
||||
proxy['tls-fingerprint'] = proxy.fingerprint;
|
||||
}
|
||||
|
||||
if (proxy['benchmark-url']) {
|
||||
proxy['test-url'] = proxy['benchmark-url'];
|
||||
}
|
||||
|
@ -46,8 +46,19 @@ function Clash() {
|
||||
};
|
||||
const parse = function (raw) {
|
||||
// Clash YAML format
|
||||
const proxies = safeLoad(raw).proxies;
|
||||
return proxies.map((p) => JSON.stringify(p)).join('\n');
|
||||
const {
|
||||
proxies,
|
||||
'global-client-fingerprint': globalClientFingerprint,
|
||||
} = safeLoad(raw);
|
||||
return proxies
|
||||
.map((p) => {
|
||||
// https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml#L73C1-L73C26
|
||||
if (globalClientFingerprint && !p['client-fingerprint']) {
|
||||
p['client-fingerprint'] = globalClientFingerprint;
|
||||
}
|
||||
return JSON.stringify(p);
|
||||
})
|
||||
.join('\n');
|
||||
};
|
||||
return { name, test, parse };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user