Skip to content

Commit 3efd39c

Browse files
committed
feat: TUIC alpn 默认为 h3, congestion-controller 默认为 cubic, udp-relay-mode 默认为 native
1 parent 6437946 commit 3efd39c

3 files changed

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,14 @@ function lastParse(proxy) {
661661
delete proxy['shadow-tls-password'];
662662
delete proxy['shadow-tls-version'];
663663
}
664+
if (['tuic'].includes(proxy.type)) {
665+
proxy.alpn = Array.isArray(proxy.alpn)
666+
? proxy.alpn
667+
: [proxy.alpn || 'h3'];
668+
proxy['congestion-controller'] =
669+
proxy['congestion-controller'] || 'cubic';
670+
proxy['udp-relay-mode'] = proxy['udp-relay-mode'] || 'native';
671+
}
664672
return proxy;
665673
}
666674

backend/src/utils/flow.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ export function normalizeFlowHeader(flowHeaders, splitHeaders) {
457457
return splitHeaders ? headers : headers['subscription-userinfo'];
458458
} catch (e) {
459459
$.error(`normalizeFlowHeader failed: ${e.message ?? e}`);
460-
return flowHeaders;
460+
return splitHeaders
461+
? {
462+
'subscription-userinfo': flowHeaders,
463+
}
464+
: flowHeaders;
461465
}
462466
}

0 commit comments

Comments
 (0)