diff --git a/backend/package.json b/backend/package.json index 0ecb7f54..c872155a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.31.3", + "version": "2.31.4", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "packageManager": "pnpm@11.0.9", diff --git a/backend/src/core/proxy-utils/processors/index.js b/backend/src/core/proxy-utils/processors/index.js index 1ec5a679..cc29d3fb 100644 --- a/backend/src/core/proxy-utils/processors/index.js +++ b/backend/src/core/proxy-utils/processors/index.js @@ -155,6 +155,20 @@ function QuickSettingOperator(args) { if (proxy.type === 'vmess') { proxy.aead = get(args['vmess aead'], proxy.aead); } + if (['snell', 'anytls', 'trusttunnel'].includes(proxy.type)) { + proxy.reuse = get(args.reuse, proxy.reuse); + } + if (['tuic', 'hysteria2'].includes(proxy.type)) { + proxy.ecn = get(args.ecn, proxy.ecn); + } + proxy['block-quic'] = getBlockQuic( + args['block-quic'], + proxy['block-quic'], + ); + proxy['ip-version'] = getValue( + args['ip-version'], + proxy['ip-version'], + ); return proxy; }); }, @@ -170,6 +184,29 @@ function QuickSettingOperator(args) { return defaultValue; } } + + function getBlockQuic(value, defaultValue) { + switch (value) { + case 'auto': + case 'on': + case 'off': + return value; + default: + return defaultValue; + } + } + + function getValue(value, defaultValue) { + switch (value) { + case undefined: + case null: + case '': + case 'DEFAULT': + return defaultValue; + default: + return value; + } + } } // add or remove flag for proxies