Skip to content

Commit efe0692

Browse files
committed
feat: Egern 支持 Snell+ShadowTLS
1 parent 8cd5fd9 commit efe0692

3 files changed

Lines changed: 18 additions & 39 deletions

File tree

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.0",
3+
"version": "2.36.1",
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/producers/egern.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ export default function Egern_Producer() {
9292
normalizeSnellVersion(proxy.version) === null
9393
) {
9494
return false;
95-
} else if (proxy.type === 'snell' && hasShadowTls(proxy)) {
96-
$.error(
97-
`Platform Egern does not support Snell shadow-tls proxy ${proxy.name}. Proxy has been filtered.`,
98-
);
99-
return false;
10095
} else if (
10196
['anytls'].includes(proxy.type) &&
10297
proxy.network &&
@@ -552,6 +547,7 @@ export default function Egern_Producer() {
552547
'vmess',
553548
'anytls',
554549
'ssh',
550+
'snell',
555551
].includes(original.type)
556552
) {
557553
if (
@@ -683,10 +679,6 @@ function getUdpRelay(proxy) {
683679
return proxy.udp ?? proxy.udp_relay;
684680
}
685681

686-
function hasShadowTls(proxy) {
687-
return proxy.plugin === 'shadow-tls';
688-
}
689-
690682
function getNonEmptyValue(value) {
691683
if (value == null) return undefined;
692684
if (typeof value === 'string' && value.length === 0) return undefined;

backend/src/test/proxy-producers/structured.spec.js

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,11 +2382,11 @@ describe('Proxy structured producers', function () {
23822382
}
23832383
});
23842384

2385-
it('filters Egern Snell shadow-tls variants', function () {
2385+
it('emits Egern Snell shadow-tls variants', function () {
23862386
const proxies = [
23872387
{
23882388
type: 'snell',
2389-
name: 'Egern Snell ShadowTLS Plugin A',
2389+
name: 'Egern Snell ShadowTLS',
23902390
server: 'snell-shadowtls.example.com',
23912391
port: 44046,
23922392
psk: 'secret',
@@ -2398,20 +2398,6 @@ describe('Proxy structured producers', function () {
23982398
version: 3,
23992399
},
24002400
},
2401-
{
2402-
type: 'snell',
2403-
name: 'Egern Snell ShadowTLS Plugin',
2404-
server: 'snell-plugin.example.com',
2405-
port: 44046,
2406-
psk: 'secret',
2407-
version: 4,
2408-
plugin: 'shadow-tls',
2409-
'plugin-opts': {
2410-
host: 'mask.example.com',
2411-
password: 'shadow-pass',
2412-
version: 3,
2413-
},
2414-
},
24152401
{
24162402
type: 'snell',
24172403
name: 'Egern Snell Plain',
@@ -2422,22 +2408,23 @@ describe('Proxy structured producers', function () {
24222408
},
24232409
];
24242410

2425-
const { result: internal, errors } = captureErrors(() =>
2426-
produceInternal('Egern', proxies),
2427-
);
2428-
const { result: external, errors: externalErrors } = captureErrors(() =>
2429-
loadProducedYaml('Egern', proxies),
2430-
);
2431-
2432-
expect(errors).to.deep.equal([
2433-
'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Plugin A. Proxy has been filtered.',
2434-
'Platform Egern does not support Snell shadow-tls proxy Egern Snell ShadowTLS Plugin. Proxy has been filtered.',
2435-
]);
2436-
expect(externalErrors).to.deep.equal(errors);
2411+
const internal = produceInternal('Egern', proxies);
2412+
const external = loadProducedYaml('Egern', proxies);
24372413

24382414
for (const output of [internal, external.proxies]) {
2439-
expect(output).to.have.length(1);
2415+
expect(output).to.have.length(2);
24402416
expectSubset(output[0], {
2417+
snell: {
2418+
name: 'Egern Snell ShadowTLS',
2419+
server: 'snell-shadowtls.example.com',
2420+
version: 5,
2421+
shadow_tls: {
2422+
password: 'shadow-pass',
2423+
sni: 'mask.example.com',
2424+
},
2425+
},
2426+
});
2427+
expectSubset(output[1], {
24412428
snell: {
24422429
name: 'Egern Snell Plain',
24432430
server: 'snell.example.com',

0 commit comments

Comments
 (0)