Skip to content

Commit b63f608

Browse files
committed
feat: mihomo 出站支持 Shadow QUIC; 协议过滤支持 Shadow QUIC
1 parent 87c43fe commit b63f608

6 files changed

Lines changed: 22 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Sub-Store also supports a configurable browser CORS allowlist for the backend AP
8383
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS, AnyTLS)
8484
- [x] Loon (SS, SSR, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, WireGuard, VLESS, Hysteria 2, AnyTLS)
8585
- [x] Surge (Direct, SS, VMess, Trojan, HTTP, HTTPS, HTTP/2 CONNECT, SOCKS5, SOCKS5-TLS, AnyTLS, TrustTunnel, TUIC, Snell, Hysteria 2, SSH(Password authentication only), External Proxy Program(only for macOS), WireGuard(Surge to Surge))
86-
- [x] mihomo(Clash.Meta) Compatible (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS, MASQUE, Tailscale, GOST Relay)
86+
- [x] mihomo(Clash.Meta) Compatible (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, sudoku, AnyTLS, MASQUE, Tailscale, GOST Relay, Shadow QUIC)
8787

8888
Deprecated(The frontend doesn't show it, but the backend still supports it, with the query parameter `target=Clash`):
8989

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.4",
3+
"version": "2.36.5",
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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ function produce(proxies, targetPlatform, type, opts = {}) {
425425
!supportsRootProxyHeaders(proxy, targetPlatform)
426426
) {
427427
$.error(
428-
`Target platform ${targetPlatform} does not support headers for ${getRootHeaderProxyLabel(proxy)} proxy ${proxy.name || `${proxy.server}:${proxy.port}`}. Proxy has been filtered.`,
428+
`Target platform ${targetPlatform} does not support headers for ${getRootHeaderProxyLabel(
429+
proxy,
430+
)} proxy ${
431+
proxy.name || `${proxy.server}:${proxy.port}`
432+
}. Proxy has been filtered.`,
429433
);
430434
return false;
431435
}
@@ -623,9 +627,7 @@ function supportsRootProxyHeaders(proxy, targetPlatform) {
623627
}
624628

625629
if (
626-
['clashmeta', 'clash.meta', 'meta', 'mihomo'].includes(
627-
normalizedTarget,
628-
)
630+
['clashmeta', 'clash.meta', 'meta', 'mihomo'].includes(normalizedTarget)
629631
) {
630632
return proxy.type === 'http';
631633
}
@@ -861,6 +863,8 @@ function lastParse(proxy) {
861863
'trusttunnel',
862864
'h2-connect',
863865
'naive',
866+
'masque',
867+
'shadowquic',
864868
].includes(proxy.type)
865869
) {
866870
proxy.tls = true;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,6 +2524,7 @@ function Clash_All() {
25242524
}
25252525
if (
25262526
![
2527+
'shadowquic',
25272528
'gost-relay',
25282529
'openvpn',
25292530
'tailscale',

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ export default function ClashMeta_Producer() {
356356
'anytls',
357357
'trusttunnel',
358358
'naive',
359+
'masque',
360+
'shadowquic',
359361
].includes(proxy.type)
360362
) {
361363
delete proxy.tls;
@@ -456,7 +458,10 @@ function getMihomoShadowTlsOpts(proxy) {
456458
if (proxy?.plugin === 'shadow-tls' && proxy?.['plugin-opts']) {
457459
return proxy['plugin-opts'];
458460
}
459-
if (proxy?.type === 'snell' && proxy?.['obfs-opts']?.mode === 'shadow-tls') {
461+
if (
462+
proxy?.type === 'snell' &&
463+
proxy?.['obfs-opts']?.mode === 'shadow-tls'
464+
) {
460465
return proxy['obfs-opts'];
461466
}
462467
return undefined;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default function Shadowrocket_Producer() {
4545
'naive',
4646
'openvpn',
4747
'gost-relay',
48+
'shadowquic',
4849
].includes(proxy.type)
4950
) {
5051
return false;
@@ -151,8 +152,7 @@ export default function Shadowrocket_Producer() {
151152
version: proxy['plugin-opts'].version,
152153
};
153154
if (proxy['plugin-opts'].alpn) {
154-
proxy['obfs-opts'].alpn =
155-
proxy['plugin-opts'].alpn;
155+
proxy['obfs-opts'].alpn = proxy['plugin-opts'].alpn;
156156
}
157157
delete proxy.plugin;
158158
delete proxy['plugin-opts'];
@@ -207,9 +207,9 @@ export default function Shadowrocket_Producer() {
207207
proxy['h2-opts']?.headers?.host ??
208208
proxy['h2-opts']?.headers?.Host;
209209
if (
210-
(isPresent(proxy, 'h2-opts.host') ||
211-
isPresent(proxy, 'h2-opts.headers.host') ||
212-
isPresent(proxy, 'h2-opts.headers.Host'))
210+
isPresent(proxy, 'h2-opts.host') ||
211+
isPresent(proxy, 'h2-opts.headers.host') ||
212+
isPresent(proxy, 'h2-opts.headers.Host')
213213
) {
214214
proxy['h2-opts'].host = Array.isArray(host)
215215
? host

0 commit comments

Comments
 (0)