feat: 调整 Egern VMess security 逻辑

This commit is contained in:
xream 2025-02-06 18:18:15 +08:00
parent bf18c51f6a
commit e14944dd19
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.16.29", "version": "2.16.30",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -52,15 +52,8 @@ export default function Egern_Producer() {
'2022-blake3-aes-256-gcm', '2022-blake3-aes-256-gcm',
].includes(proxy.cipher))) || ].includes(proxy.cipher))) ||
(proxy.type === 'vmess' && (proxy.type === 'vmess' &&
(![ !['http', 'ws', 'tcp'].includes(proxy.network) &&
'auto', proxy.network) ||
'aes-128-gcm',
'chacha20-poly1305',
'none',
'zero',
].includes(proxy.cipher) ||
(!['http', 'ws', 'tcp'].includes(proxy.network) &&
proxy.network))) ||
(proxy.type === 'trojan' && (proxy.type === 'trojan' &&
!['http', 'ws', 'tcp'].includes(proxy.network) && !['http', 'ws', 'tcp'].includes(proxy.network) &&
proxy.network) || proxy.network) ||
@ -191,6 +184,19 @@ export default function Egern_Producer() {
websocket: proxy.websocket, websocket: proxy.websocket,
}; };
} else if (proxy.type === 'vmess') { } else if (proxy.type === 'vmess') {
let security = proxy.cipher;
if (
security &&
![
'auto',
'none',
'zero',
'aes-128-gcm',
'chacha20-poly1305',
].includes(security)
) {
security = 'auto';
}
if (proxy.network === 'ws') { if (proxy.network === 'ws') {
proxy.transport = { proxy.transport = {
[proxy.tls ? 'wss' : 'ws']: { [proxy.tls ? 'wss' : 'ws']: {
@ -235,7 +241,7 @@ export default function Egern_Producer() {
server: proxy.server, server: proxy.server,
port: proxy.port, port: proxy.port,
user_id: proxy.uuid, user_id: proxy.uuid,
security: proxy.cipher, security,
tfo: proxy.tfo || proxy['fast-open'], tfo: proxy.tfo || proxy['fast-open'],
legacy: proxy.legacy, legacy: proxy.legacy,
udp_relay: udp_relay: