Skip to content

Commit c3c0dac

Browse files
committed
mihomo 从全局配置获取的 global-client-fingerprint 和默认的 client-fingerprint 仅用于 VMess/VLESS/Trojan 协议
1 parent c1a8503 commit c3c0dac

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.20.75",
3+
"version": "2.20.78",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/preprocessors/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ function Clash() {
111111
(includeProxies ? 'proxies:\n' : '') +
112112
proxies
113113
.map((p) => {
114-
// https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml#L73C1-L73C26
115-
if (globalClientFingerprint && !p['client-fingerprint']) {
114+
if (
115+
globalClientFingerprint &&
116+
['trojan', 'vmess', 'vless'].includes(p.type) &&
117+
!p['client-fingerprint']
118+
) {
116119
p['client-fingerprint'] = globalClientFingerprint;
117120
}
118121
return `${includeProxies ? ' - ' : ''}${JSON.stringify(

backend/src/core/proxy-utils/producers/clashmeta.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ export default function ClashMeta_Producer() {
7373
return true;
7474
})
7575
.map((proxy) => {
76-
proxy['client-fingerprint'] =
77-
proxy['client-fingerprint'] || 'chrome';
76+
if (['trojan', 'vmess', 'vless'].includes(proxy.type)) {
77+
proxy['client-fingerprint'] =
78+
proxy['client-fingerprint'] || 'chrome';
79+
}
7880
if (proxy.type === 'vmess') {
7981
// handle vmess aead
8082
if (isPresent(proxy, 'aead')) {

0 commit comments

Comments
 (0)