From 54b5cbd746bd7be555a36e168250eba5331eeac9 Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 27 Feb 2026 00:32:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Egern=20=E6=94=AF=E6=8C=81=20AnyTLS.=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AF=B7=E6=B1=82=E7=9A=84=20User-Agent=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=BC=80=E5=90=AF,=20=E6=88=96=E4=BD=BF=E7=94=A8=20includeUnsu?= =?UTF-8?q?pportedProxy=20=E5=8F=82=E6=95=B0=E6=88=96=E5=BC=80=E5=90=AF=20?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E5=AE=98=E6=96=B9/=E5=95=86=E5=BA=97?= =?UTF-8?q?=E7=89=88=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=20=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- .../src/core/proxy-utils/producers/egern.js | 30 +++++++++++++++++-- backend/src/utils/user-agent.js | 14 ++++----- 3 files changed, 35 insertions(+), 11 deletions(-) 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' &&