mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 01:29:00 +08:00
feat: hysteria
This commit is contained in:
parent
9cbbd0e86f
commit
4c6ba2cdc8
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.26",
|
||||
"version": "2.14.27",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -188,6 +188,8 @@ function lastParse(proxy) {
|
||||
if (proxy.network === 'tcp') {
|
||||
delete proxy.network;
|
||||
}
|
||||
}
|
||||
if (['trojan', 'tuic', 'hysteria'].includes(proxy.type)) {
|
||||
proxy.tls = true;
|
||||
}
|
||||
if (proxy.tls && !proxy.sni) {
|
||||
|
@ -344,6 +344,7 @@ function Clash_All() {
|
||||
'trojan',
|
||||
'tuic',
|
||||
'vless',
|
||||
'hysteria',
|
||||
].includes(proxy.type)
|
||||
) {
|
||||
throw new Error(
|
||||
|
@ -74,7 +74,9 @@ export default function Clash_Producer() {
|
||||
proxy['http-opts'].headers.Host = [httpHost];
|
||||
}
|
||||
}
|
||||
|
||||
if (['trojan', 'tuic', 'hysteria'].includes(proxy.type)) {
|
||||
delete proxy.tls;
|
||||
}
|
||||
delete proxy['tls-fingerprint'];
|
||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||
})
|
||||
|
@ -49,6 +49,12 @@ export default function Stash_Producer() {
|
||||
} else {
|
||||
proxy.alpn = ['h3'];
|
||||
}
|
||||
if (
|
||||
isPresent(proxy, 'tfo') &&
|
||||
!isPresent(proxy, 'fast-open')
|
||||
) {
|
||||
proxy['fast-open'] = proxy.tfo;
|
||||
}
|
||||
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/adapter/outbound/tuic.go#L197
|
||||
if (
|
||||
(!proxy.token || proxy.token.length === 0) &&
|
||||
@ -56,6 +62,18 @@ export default function Stash_Producer() {
|
||||
) {
|
||||
proxy.version = 5;
|
||||
}
|
||||
} else if (proxy.type === 'hysteria') {
|
||||
if (isPresent(proxy, 'alpn')) {
|
||||
proxy.alpn = Array.isArray(proxy.alpn)
|
||||
? proxy.alpn
|
||||
: [proxy.alpn];
|
||||
}
|
||||
if (
|
||||
isPresent(proxy, 'tfo') &&
|
||||
!isPresent(proxy, 'fast-open')
|
||||
) {
|
||||
proxy['fast-open'] = proxy.tfo;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@ -78,6 +96,10 @@ export default function Stash_Producer() {
|
||||
}
|
||||
}
|
||||
|
||||
if (['trojan', 'tuic', 'hysteria'].includes(proxy.type)) {
|
||||
delete proxy.tls;
|
||||
}
|
||||
|
||||
delete proxy['tls-fingerprint'];
|
||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||
})
|
||||
|
@ -61,6 +61,12 @@ export default function Stash_Producer() {
|
||||
} else {
|
||||
proxy.alpn = ['h3'];
|
||||
}
|
||||
if (
|
||||
isPresent(proxy, 'tfo') &&
|
||||
!isPresent(proxy, 'fast-open')
|
||||
) {
|
||||
proxy['fast-open'] = proxy.tfo;
|
||||
}
|
||||
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/adapter/outbound/tuic.go#L197
|
||||
if (
|
||||
(!proxy.token || proxy.token.length === 0) &&
|
||||
@ -68,6 +74,18 @@ export default function Stash_Producer() {
|
||||
) {
|
||||
proxy.version = 5;
|
||||
}
|
||||
} else if (proxy.type === 'hysteria') {
|
||||
if (isPresent(proxy, 'alpn')) {
|
||||
proxy.alpn = Array.isArray(proxy.alpn)
|
||||
? proxy.alpn
|
||||
: [proxy.alpn];
|
||||
}
|
||||
if (
|
||||
isPresent(proxy, 'tfo') &&
|
||||
!isPresent(proxy, 'fast-open')
|
||||
) {
|
||||
proxy['fast-open'] = proxy.tfo;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@ -89,7 +107,9 @@ export default function Stash_Producer() {
|
||||
proxy['http-opts'].headers.Host = [httpHost];
|
||||
}
|
||||
}
|
||||
|
||||
if (['trojan', 'tuic', 'hysteria'].includes(proxy.type)) {
|
||||
delete proxy.tls;
|
||||
}
|
||||
delete proxy['tls-fingerprint'];
|
||||
return ' - ' + JSON.stringify(proxy) + '\n';
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user