diff --git a/backend/package.json b/backend/package.json index c8efa79a..ef8e5cf9 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.21.28", + "version": "2.21.29", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/producers/egern.js b/backend/src/core/proxy-utils/producers/egern.js index 05085a08..689d4b2a 100644 --- a/backend/src/core/proxy-utils/producers/egern.js +++ b/backend/src/core/proxy-utils/producers/egern.js @@ -18,9 +18,9 @@ export default function Egern_Producer() { 'vmess', 'tuic', 'wireguard', - // ...(opts['include-unsupported-proxy'] - // ? ['wireguard'] - // : []), + ...(opts['include-unsupported-proxy'] + ? ['anytls'] + : []), ].includes(proxy.type) || (proxy.type === 'ss' && ((proxy.plugin === 'obfs' && @@ -75,6 +75,14 @@ export default function Egern_Producer() { proxy.token.length !== 0) ) { return false; + } else if ( + ['anytls'].includes(proxy.type) && + proxy.network && + (!['tcp'].includes(proxy.network) || + (['tcp'].includes(proxy.network) && + proxy['reality-opts'])) + ) { + return false; } else if ( ['ws'].includes(proxy.network) && proxy['ws-opts']?.['v2ray-http-upgrade'] @@ -207,6 +215,20 @@ export default function Egern_Producer() { skip_tls_verify: proxy['skip-cert-verify'], websocket: proxy.websocket, }; + } else if (proxy.type === 'anytls') { + proxy = { + type: 'anytls', + name: proxy.name, + server: proxy.server, + port: proxy.port, + password: proxy.password, + tfo: proxy.tfo || proxy['fast-open'], + udp_relay: + proxy.udp || proxy.udp_relay || proxy.udp_relay, + next_hop: proxy.next_hop, + sni: proxy.sni, + skip_tls_verify: proxy['skip-cert-verify'], + }; } else if (proxy.type === 'vmess') { // Egern:传输层,支持 ws/wss/http1/http2/tls,不配置则为 tcp let security = proxy.cipher; @@ -428,6 +450,7 @@ export default function Egern_Producer() { 'trojan', 'vless', 'vmess', + 'anytls', ].includes(original.type) ) { if (isPresent(original, 'shadow-tls-password')) { @@ -463,6 +486,7 @@ export default function Egern_Producer() { 'wireguard', 'tuic', 'hysteria2', + 'anytls', ].includes(original.type) ) { if ( diff --git a/backend/src/utils/user-agent.js b/backend/src/utils/user-agent.js index 9382b065..60983985 100644 --- a/backend/src/utils/user-agent.js +++ b/backend/src/utils/user-agent.js @@ -75,13 +75,13 @@ export function shouldIncludeUnsupportedProxy(platform, ua) { ) { return true; } - // if ( - // platform === 'Egern' && - // target === 'Egern' && - // ua.match(/build\/(\d+)/i)?.[1] >= 698 - // ) { - // return true; - // } + if ( + platform === 'Egern' && + target === 'Egern' && + ua.match(/build\/(\d+)/i)?.[1] >= 718 + ) { + return true; + } // // if ( // // platform === 'Stash' && // // target === 'Stash' &&