feat: 调整 Egern VMess 传输层

This commit is contained in:
xream 2025-02-10 21:02:40 +08:00
parent bd21d58fe7
commit 7002eee88d
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 18 additions and 2 deletions

View File

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

View File

@ -184,6 +184,7 @@ export default function Egern_Producer() {
websocket: proxy.websocket,
};
} else if (proxy.type === 'vmess') {
// Egern传输层支持 ws/wss/http1/http2/tls不配置则为 tcp
let security = proxy.cipher;
if (
security &&
@ -212,7 +213,7 @@ export default function Egern_Producer() {
};
} else if (proxy.network === 'http') {
proxy.transport = {
http: {
http1: {
method: proxy['http-opts']?.method,
path: proxy['http-opts']?.path,
headers: {
@ -225,6 +226,21 @@ export default function Egern_Producer() {
skip_tls_verify: proxy['skip-cert-verify'],
},
};
} else if (proxy.network === 'h2') {
proxy.transport = {
http2: {
method: proxy['h2-opts']?.method,
path: proxy['h2-opts']?.path,
headers: {
Host: Array.isArray(
proxy['h2-opts']?.headers?.Host,
)
? proxy['h2-opts']?.headers?.Host[0]
: proxy['h2-opts']?.headers?.Host,
},
skip_tls_verify: proxy['skip-cert-verify'],
},
};
} else if (proxy.network === 'tcp' || !proxy.network) {
proxy.transport = {
[proxy.tls ? 'tls' : 'tcp']: {