mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-12-02 09:23:54 +00:00
feat: Egern 支持 Snell+ShadowTLS
This commit is contained in:
3 files changed
+18
-39
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user