From 643794614524d270905f82e1be568bfcc804cfea Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 19 Jan 2026 10:41:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20VLESS=20=E6=94=AF=E6=8C=81=20ech,=20h2?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 2 ++ backend/src/core/proxy-utils/producers/uri.js | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index ff28052e..af03beaa 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.21.8", + "version": "2.21.9", "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 85ccf458..ba092412 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -741,7 +741,9 @@ function URI_VLESS() { proxy['client-fingerprint'] = params.fp; proxy.alpn = params.alpn ? params.alpn.split(',') : undefined; proxy['skip-cert-verify'] = /(TRUE)|1/i.test(params.allowInsecure); + proxy._ech = getIfPresent(params.ech); proxy._pcs = getIfPresent(params.pcs); + proxy._h2 = /(TRUE)|1/i.test(params.h2); if (['reality'].includes(params.security)) { const opts = {}; diff --git a/backend/src/core/proxy-utils/producers/uri.js b/backend/src/core/proxy-utils/producers/uri.js index f1984664..ed8f2f0e 100644 --- a/backend/src/core/proxy-utils/producers/uri.js +++ b/backend/src/core/proxy-utils/producers/uri.js @@ -36,10 +36,18 @@ function vless(proxy) { if (proxy['skip-cert-verify']) { allowInsecure = `&allowInsecure=1`; } + let h2 = ''; + if (proxy._h2) { + h2 = `&h2=1`; + } let pcs = ''; if (proxy._pcs) { pcs = `&pcs=${encodeURIComponent(proxy._pcs)}`; } + let ech = ''; + if (proxy._ech) { + ech = `&ech=${encodeURIComponent(proxy._ech)}`; + } let sni = ''; if (proxy.sni) { sni = `&sni=${encodeURIComponent(proxy.sni)}`; @@ -123,7 +131,7 @@ function vless(proxy) { proxy.port }?security=${encodeURIComponent( security, - )}${vlessTransport}${alpn}${allowInsecure}${pcs}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${pqv}${encryption}#${encodeURIComponent( + )}${vlessTransport}${alpn}${allowInsecure}${pcs}${ech}${h2}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${pqv}${encryption}#${encodeURIComponent( proxy.name, )}`; }