From efe06924962db5eeb875e22f61736ade3212edd4 Mon Sep 17 00:00:00 2001 From: xream Date: Fri, 10 Jul 2026 12:27:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Egern=20=E6=94=AF=E6=8C=81=20Snell+Shad?= =?UTF-8?q?owTLS?= 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 | 10 +---- .../test/proxy-producers/structured.spec.js | 45 +++++++------------ 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/backend/package.json b/backend/package.json index dce5eba7..1985cc32 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.36.0", + "version": "2.36.1", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "packageManager": "pnpm@11.0.9", diff --git a/backend/src/core/proxy-utils/producers/egern.js b/backend/src/core/proxy-utils/producers/egern.js index 06396e07..e2eca8da 100644 --- a/backend/src/core/proxy-utils/producers/egern.js +++ b/backend/src/core/proxy-utils/producers/egern.js @@ -92,11 +92,6 @@ export default function Egern_Producer() { normalizeSnellVersion(proxy.version) === null ) { return false; - } else if (proxy.type === 'snell' && hasShadowTls(proxy)) { - $.error( - `Platform Egern does not support Snell shadow-tls proxy ${proxy.name}. Proxy has been filtered.`, - ); - return false; } else if ( ['anytls'].includes(proxy.type) && proxy.network && @@ -552,6 +547,7 @@ export default function Egern_Producer() { 'vmess', 'anytls', 'ssh', + 'snell', ].includes(original.type) ) { if ( @@ -683,10 +679,6 @@ function getUdpRelay(proxy) { return proxy.udp ?? proxy.udp_relay; } -function hasShadowTls(proxy) { - return proxy.plugin === 'shadow-tls'; -} - function getNonEmptyValue(value) { if (value == null) return undefined; if (typeof value === 'string' && value.length === 0) return undefined; diff --git a/backend/src/test/proxy-producers/structured.spec.js b/backend/src/test/proxy-producers/structured.spec.js index 1ba94e72..54c40f2a 100644 --- a/backend/src/test/proxy-producers/structured.spec.js +++ b/backend/src/test/proxy-producers/structured.spec.js @@ -2382,11 +2382,11 @@ describe('Proxy structured producers', function () { } }); - it('filters Egern Snell shadow-tls variants', function () { + it('emits Egern Snell shadow-tls variants', function () { const proxies = [ { type: 'snell', - name: 'Egern Snell ShadowTLS Plugin A', + name: 'Egern Snell ShadowTLS', server: 'snell-shadowtls.example.com', port: 44046, psk: 'secret', @@ -2398,20 +2398,6 @@ describe('Proxy structured producers', function () { version: 3, }, }, - { - type: 'snell', - name: 'Egern Snell ShadowTLS Plugin', - server: 'snell-plugin.example.com', - port: 44046, - psk: 'secret', - version: 4, - plugin: 'shadow-tls', - 'plugin-opts': { - host: 'mask.example.com', - password: 'shadow-pass', - version: 3, - }, - }, { type: 'snell', name: 'Egern Snell Plain', @@ -2422,22 +2408,23 @@ describe('Proxy structured producers', function () { }, ]; - const { result: internal, errors } = captureErrors(() => - produceInternal('Egern', proxies), - ); - const { result: external, errors: externalErrors } = captureErrors(() => - loadProducedYaml('Egern', proxies), - ); - - expect(errors).to.deep.equal([ - 'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Plugin A. Proxy has been filtered.', - 'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Plugin. Proxy has been filtered.', - ]); - expect(externalErrors).to.deep.equal(errors); + const internal = produceInternal('Egern', proxies); + const external = loadProducedYaml('Egern', proxies); for (const output of [internal, external.proxies]) { - expect(output).to.have.length(1); + expect(output).to.have.length(2); expectSubset(output[0], { + snell: { + name: 'Egern Snell ShadowTLS', + server: 'snell-shadowtls.example.com', + version: 5, + shadow_tls: { + password: 'shadow-pass', + sni: 'mask.example.com', + }, + }, + }); + expectSubset(output[1], { snell: { name: 'Egern Snell Plain', server: 'snell.example.com',