Skip to content

Commit

Permalink
feat: 调整 Egern VMess 传输层
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 10, 2025
1 parent bd21d58 commit 7002eee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
18 changes: 17 additions & 1 deletion backend/src/core/proxy-utils/producers/egern.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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: {
Expand All @@ -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']: {
Expand Down

0 comments on commit 7002eee

Please sign in to comment.