diff --git a/backend/package.json b/backend/package.json index fb885f5..bbcf424 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.16.51", + "version": "2.16.52", "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 5848997..14b44a5 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -190,6 +190,8 @@ function URI_SS() { // handle obfs const pluginMatch = content.match(/[?&]plugin=([^&]+)/); + const shadowTlsMatch = content.match(/[?&]shadow-tls=([^&]+)/); + if (pluginMatch) { const pluginInfo = ( 'plugin=' + decodeURIComponent(pluginMatch[1]) @@ -233,6 +235,25 @@ function URI_SS() { ); } } + // Shadowrocket + if (shadowTlsMatch) { + const params = JSON.parse(Base64.decode(shadowTlsMatch[1])); + const version = getIfNotBlank(params['version']); + const address = getIfNotBlank(params['address']); + const port = getIfNotBlank(params['port']); + proxy.plugin = 'shadow-tls'; + proxy['plugin-opts'] = { + host: getIfNotBlank(params['host']), + password: getIfNotBlank(params['password']), + version: version ? parseInt(version, 10) : undefined, + }; + if (address) { + proxy.server = address; + } + if (port) { + proxy.port = parseInt(port, 10); + } + } if (/(&|\?)uot=(1|true)/i.test(query)) { proxy['udp-over-tcp'] = true; } diff --git a/backend/src/core/proxy-utils/producers/clashmeta.js b/backend/src/core/proxy-utils/producers/clashmeta.js index 129fe1a..a4ce889 100644 --- a/backend/src/core/proxy-utils/producers/clashmeta.js +++ b/backend/src/core/proxy-utils/producers/clashmeta.js @@ -105,6 +105,9 @@ export default function ClashMeta_Producer() { password: proxy['shadow-tls-password'], version: proxy['shadow-tls-version'], }; + delete proxy['shadow-tls-password']; + delete proxy['shadow-tls-sni']; + delete proxy['shadow-tls-version']; } }