diff --git a/backend/package.json b/backend/package.json index f4b7462..7bf0ccc 100644 --- a/backend/package.json +++ b/backend/package.json @@ -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": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index d5bb588..c5b1ecb 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -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']; } diff --git a/backend/src/core/proxy-utils/preprocessors/index.js b/backend/src/core/proxy-utils/preprocessors/index.js index 1c57cf0..01c2342 100644 --- a/backend/src/core/proxy-utils/preprocessors/index.js +++ b/backend/src/core/proxy-utils/preprocessors/index.js @@ -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 }; }