From 3637c5eb7449db7f53be76eac74ed7d5cae16792 Mon Sep 17 00:00:00 2001 From: xream Date: Wed, 13 Mar 2024 16:24:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20SSH=20=E5=8D=8F=E8=AE=AE=E8=B7=9F?= =?UTF-8?q?=E8=BF=9B=20clash.meta(mihomo)=20=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/producers/sing-box.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index ecb825b47..cc9f5721a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.251", + "version": "2.14.252", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/producers/sing-box.js b/backend/src/core/proxy-utils/producers/sing-box.js index 50eb5c2b1..116486518 100644 --- a/backend/src/core/proxy-utils/producers/sing-box.js +++ b/backend/src/core/proxy-utils/producers/sing-box.js @@ -231,6 +231,10 @@ const sshParser = (proxy = {}) => { // https://wiki.metacubex.one/config/proxies/ssh // https://sing-box.sagernet.org/zh/configuration/outbound/ssh if (proxy['privateKey']) parsedProxy.private_key_path = proxy['privateKey']; + if (proxy['private-key']) + parsedProxy.private_key_path = proxy['private-key']; + if (proxy['private-key-passphrase']) + parsedProxy.private_key_passphrase = proxy['private-key-passphrase']; if (proxy['server-fingerprint']) { parsedProxy.host_key = [proxy['server-fingerprint']]; // https://manual.nssurge.com/policy/ssh.html @@ -240,6 +244,9 @@ const sshParser = (proxy = {}) => { proxy['server-fingerprint'].split(' ')[0], ]; } + if (proxy['host-key']) parsedProxy.host_key = proxy['host-key']; + if (proxy['host-key-algorithms']) + parsedProxy.host_key_algorithms = proxy['host-key-algorithms']; if (proxy['fast-open']) parsedProxy.udp_fragment = true; tfoParser(proxy, parsedProxy); return parsedProxy;