From 3efd39c844830f4a1417e7920238e5bbfd067a79 Mon Sep 17 00:00:00 2001 From: xream Date: Mon, 19 Jan 2026 14:01:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20TUIC=20alpn=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=20h3,=20congestion-controller=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=20cubic,=20udp-relay-mode=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=20native?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/index.js | 8 ++++++++ backend/src/utils/flow.js | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/package.json b/backend/package.json index af03beaa..14b14a8e 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.21.9", + "version": "2.21.11", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index b83a5e25..3f266905 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -661,6 +661,14 @@ function lastParse(proxy) { delete proxy['shadow-tls-password']; delete proxy['shadow-tls-version']; } + if (['tuic'].includes(proxy.type)) { + proxy.alpn = Array.isArray(proxy.alpn) + ? proxy.alpn + : [proxy.alpn || 'h3']; + proxy['congestion-controller'] = + proxy['congestion-controller'] || 'cubic'; + proxy['udp-relay-mode'] = proxy['udp-relay-mode'] || 'native'; + } return proxy; } diff --git a/backend/src/utils/flow.js b/backend/src/utils/flow.js index 52093350..07da743a 100644 --- a/backend/src/utils/flow.js +++ b/backend/src/utils/flow.js @@ -457,6 +457,10 @@ export function normalizeFlowHeader(flowHeaders, splitHeaders) { return splitHeaders ? headers : headers['subscription-userinfo']; } catch (e) { $.error(`normalizeFlowHeader failed: ${e.message ?? e}`); - return flowHeaders; + return splitHeaders + ? { + 'subscription-userinfo': flowHeaders, + } + : flowHeaders; } }