From e3a514d1fb355e67c41a55ab95ff11f36329dc39 Mon Sep 17 00:00:00 2001 From: xream Date: Thu, 21 Mar 2024 20:07:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20hysteria2=20=E6=94=AF=E6=8C=81=20`mport?= =?UTF-8?q?`,=20clash.meta(mihomo)=20=E6=94=AF=E6=8C=81=20`ports`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/parsers/index.js | 1 + backend/src/core/proxy-utils/producers/uri.js | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index beeba2d..1b5580e 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.261", + "version": "2.14.262", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index 9e8c2cc..e38fffe 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -547,6 +547,7 @@ function URI_Hysteria2() { proxy.obfs = params.obfs; } + proxy.ports = params.mport; proxy['obfs-password'] = params['obfs-password']; proxy['skip-cert-verify'] = /(TRUE)|1/i.test(params.insecure); proxy.tfo = /(TRUE)|1/i.test(params.fastopen); diff --git a/backend/src/core/proxy-utils/producers/uri.js b/backend/src/core/proxy-utils/producers/uri.js index e66a4fe..9ef86d0 100644 --- a/backend/src/core/proxy-utils/producers/uri.js +++ b/backend/src/core/proxy-utils/producers/uri.js @@ -274,6 +274,9 @@ export default function URI_Producer() { `sni=${encodeURIComponent(proxy.sni)}`, ); } + if (proxy.ports) { + hysteria2params.push(`mport=${proxy.ports}`); + } if (proxy['tls-fingerprint']) { hysteria2params.push( `pinSHA256=${encodeURIComponent(