Skip to content

Commit 5e8100e

Browse files
committed
feat: trust-tunnel -> trusttunnel; mihomo 支持 trusttunnel; 修复 Surge trusttunnel 用户名; 优化 shouldIncludeUnsupportedProxy 逻辑
1 parent 5704c05 commit 5e8100e

13 files changed

Lines changed: 26 additions & 31 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.37",
3+
"version": "2.21.39",
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ function lastParse(proxy) {
466466
'hysteria2',
467467
'juicity',
468468
'anytls',
469-
'trust-tunnel',
469+
'trusttunnel',
470470
'naive',
471471
].includes(proxy.type)
472472
) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ function Clash_All() {
12661266
}
12671267
if (
12681268
![
1269-
'trust-tunnel',
1269+
'trusttunnel',
12701270
'naive',
12711271
'anytls',
12721272
'mieru',

backend/src/core/proxy-utils/parsers/peggy/surge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ anytls = tag equals "anytls" address (passwordk/reuse/ip_version/underlying_prox
123123
proxy.tls = true;
124124
}
125125
trust_tunnel = tag equals "trust-tunnel" address (usernamek/passwordk/reuse/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/block_quic/others)* {
126-
proxy.type = "trust-tunnel";
126+
proxy.type = "trusttunnel";
127127
proxy.tls = true;
128128
}
129129

backend/src/core/proxy-utils/parsers/peggy/surge.peg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ anytls = tag equals "anytls" address (passwordk/reuse/ip_version/underlying_prox
121121
proxy.tls = true;
122122
}
123123
trust_tunnel = tag equals "trust-tunnel" address (usernamek/passwordk/reuse/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls_fingerprint/tls_verification/sni/fast_open/tfo/block_quic/others)* {
124-
proxy.type = "trust-tunnel";
124+
proxy.type = "trusttunnel";
125125
proxy.tls = true;
126126
}
127127
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default function Clash_Producer() {
174174
'hysteria2',
175175
'juicity',
176176
'anytls',
177-
'trust-tunnel',
177+
'trusttunnel',
178178
'naive',
179179
].includes(proxy.type)
180180
) {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export default function ClashMeta_Producer() {
1616
if (opts['include-unsupported-proxy']) return true;
1717
if (proxy.type === 'snell' && proxy.version >= 4) {
1818
return false;
19-
} else if (
20-
['trust-tunnel', 'juicity', 'naive'].includes(proxy.type)
21-
) {
19+
} else if (['juicity', 'naive'].includes(proxy.type)) {
2220
return false;
2321
} else if (
2422
['ss'].includes(proxy.type) &&
@@ -251,7 +249,7 @@ export default function ClashMeta_Producer() {
251249
'hysteria2',
252250
'juicity',
253251
'anytls',
254-
'trust-tunnel',
252+
'trusttunnel',
255253
'naive',
256254
].includes(proxy.type)
257255
) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Shadowrocket_Producer() {
1111
return false;
1212
} else if (
1313
[
14-
'trust-tunnel',
14+
'trusttunnel',
1515
'mieru',
1616
'sudoku',
1717
'naive',
@@ -227,7 +227,7 @@ export default function Shadowrocket_Producer() {
227227
'hysteria2',
228228
'juicity',
229229
'anytls',
230-
'trust-tunnel',
230+
'trusttunnel',
231231
'naive',
232232
].includes(proxy.type)
233233
) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export default function Stash_Producer() {
290290
'hysteria2',
291291
'juicity',
292292
'anytls',
293-
'trust-tunnel',
293+
'trusttunnel',
294294
'naive',
295295
].includes(proxy.type)
296296
) {

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@ export default function Surge_Producer() {
6767

6868
return anytls(proxy);
6969
}
70-
if (
71-
opts['include-unsupported-proxy'] &&
72-
proxy.type === 'trust-tunnel'
73-
) {
74-
return trust_tunnel(proxy);
70+
if (opts['include-unsupported-proxy'] && proxy.type === 'trusttunnel') {
71+
return trusttunnel(proxy);
7572
}
7673
throw new Error(
7774
`Platform ${targetPlatform} does not support proxy type: ${proxy.type}`,
@@ -372,9 +369,10 @@ function anytls(proxy) {
372369

373370
return result.toString();
374371
}
375-
function trust_tunnel(proxy) {
372+
function trusttunnel(proxy) {
376373
const result = new Result(proxy);
377-
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
374+
result.append(`${proxy.name}=trust-tunnel,${proxy.server},${proxy.port}`);
375+
result.appendIfPresent(`,username="${proxy.username}"`, 'username');
378376
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
379377

380378
const ip_version = ipVersions[proxy['ip-version']] || proxy['ip-version'];

0 commit comments

Comments
 (0)