Skip to content

Commit fa4193e

Browse files
committed
feat: 支持 AnyTLS 的 disable-reuse
1 parent cfdcc03 commit fa4193e

5 files changed

Lines changed: 21 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.36.8",
3+
"version": "2.36.9",
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/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,9 @@ function lastParse(proxy) {
10391039
proxy[`${proxy.network}-opts`].path = ['/'];
10401040
}
10411041
}
1042+
if (['anytls'].includes(proxy.type) && proxy['disable-reuse']) {
1043+
proxy.reuse = false;
1044+
}
10421045
if (['', 'off'].includes(proxy.sni)) {
10431046
proxy['disable-sni'] = true;
10441047
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ export default function ClashMeta_Producer() {
252252
ds['reality-opts'] = { 'public-key': '' };
253253
}
254254
}
255+
} else if (
256+
['anytls'].includes(proxy.type) &&
257+
proxy.reuse != null &&
258+
!proxy.reuse
259+
) {
260+
proxy['disable-reuse'] = true;
261+
delete proxy.reuse;
255262
}
256263

257264
if (isPresent(proxy, 'plugin-opts.mux')) {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ export default function Shadowrocket_Producer() {
170170
// delete proxy.sni;
171171
}
172172
}
173+
} else if (
174+
['anytls'].includes(proxy.type) &&
175+
proxy.reuse != null &&
176+
!proxy.reuse
177+
) {
178+
proxy['disable-reuse'] = true;
179+
delete proxy.reuse;
173180
}
174181

175182
if (

backend/src/core/proxy-utils/producers/sing-box.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,9 @@ const anytlsParser = (proxy = {}) => {
11321132
`${proxy['min-idle-session']}`,
11331133
10,
11341134
);
1135+
if (proxy['disable-reuse'] != null) {
1136+
parsedProxy.disable_reuse = !!proxy['disable-reuse'];
1137+
}
11351138
detourParser(proxy, parsedProxy);
11361139
tlsParser(proxy, parsedProxy);
11371140
ipVersionParser(proxy, parsedProxy);

0 commit comments

Comments
 (0)