Skip to content

Commit 1c7ab29

Browse files
committed
feat: 常用配置改版, 新增连接复用/阻止 QUIC/ECN/IP 版本
1 parent 9405ac6 commit 1c7ab29

2 files changed

Lines changed: 38 additions & 1 deletion

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.31.3",
3+
"version": "2.31.4",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"packageManager": "pnpm@11.0.9",

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,20 @@ function QuickSettingOperator(args) {
155155
if (proxy.type === 'vmess') {
156156
proxy.aead = get(args['vmess aead'], proxy.aead);
157157
}
158+
if (['snell', 'anytls', 'trusttunnel'].includes(proxy.type)) {
159+
proxy.reuse = get(args.reuse, proxy.reuse);
160+
}
161+
if (['tuic', 'hysteria2'].includes(proxy.type)) {
162+
proxy.ecn = get(args.ecn, proxy.ecn);
163+
}
164+
proxy['block-quic'] = getBlockQuic(
165+
args['block-quic'],
166+
proxy['block-quic'],
167+
);
168+
proxy['ip-version'] = getValue(
169+
args['ip-version'],
170+
proxy['ip-version'],
171+
);
158172
return proxy;
159173
});
160174
},
@@ -170,6 +184,29 @@ function QuickSettingOperator(args) {
170184
return defaultValue;
171185
}
172186
}
187+
188+
function getBlockQuic(value, defaultValue) {
189+
switch (value) {
190+
case 'auto':
191+
case 'on':
192+
case 'off':
193+
return value;
194+
default:
195+
return defaultValue;
196+
}
197+
}
198+
199+
function getValue(value, defaultValue) {
200+
switch (value) {
201+
case undefined:
202+
case null:
203+
case '':
204+
case 'DEFAULT':
205+
return defaultValue;
206+
default:
207+
return value;
208+
}
209+
}
173210
}
174211

175212
// add or remove flag for proxies

0 commit comments

Comments
 (0)