Skip to content

Commit 6437946

Browse files
committed
feat: VLESS 支持 ech, h2 参数
1 parent f47bda5 commit 6437946

3 files changed

Lines changed: 12 additions & 2 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.21.8",
3+
"version": "2.21.9",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,9 @@ function URI_VLESS() {
741741
proxy['client-fingerprint'] = params.fp;
742742
proxy.alpn = params.alpn ? params.alpn.split(',') : undefined;
743743
proxy['skip-cert-verify'] = /(TRUE)|1/i.test(params.allowInsecure);
744+
proxy._ech = getIfPresent(params.ech);
744745
proxy._pcs = getIfPresent(params.pcs);
746+
proxy._h2 = /(TRUE)|1/i.test(params.h2);
745747

746748
if (['reality'].includes(params.security)) {
747749
const opts = {};

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ function vless(proxy) {
3636
if (proxy['skip-cert-verify']) {
3737
allowInsecure = `&allowInsecure=1`;
3838
}
39+
let h2 = '';
40+
if (proxy._h2) {
41+
h2 = `&h2=1`;
42+
}
3943
let pcs = '';
4044
if (proxy._pcs) {
4145
pcs = `&pcs=${encodeURIComponent(proxy._pcs)}`;
4246
}
47+
let ech = '';
48+
if (proxy._ech) {
49+
ech = `&ech=${encodeURIComponent(proxy._ech)}`;
50+
}
4351
let sni = '';
4452
if (proxy.sni) {
4553
sni = `&sni=${encodeURIComponent(proxy.sni)}`;
@@ -123,7 +131,7 @@ function vless(proxy) {
123131
proxy.port
124132
}?security=${encodeURIComponent(
125133
security,
126-
)}${vlessTransport}${alpn}${allowInsecure}${pcs}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${pqv}${encryption}#${encodeURIComponent(
134+
)}${vlessTransport}${alpn}${allowInsecure}${pcs}${ech}${h2}${sni}${fp}${flow}${sid}${spx}${pbk}${mode}${extra}${pqv}${encryption}#${encodeURIComponent(
127135
proxy.name,
128136
)}`;
129137
}

0 commit comments

Comments
 (0)