Skip to content

Commit 2ea46dc

Browse files
committed
feat: Shadowsocks URI 部分逻辑修正
1 parent 4a2a229 commit 2ea46dc

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.16.32",
3+
"version": "2.16.33",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { findByName } from '@/utils/database';
2121
import { produceArtifact } from '@/restful/sync';
2222
import { getFlag, removeFlag, getISO, MMDB } from '@/utils/geo';
2323
import Gist from '@/utils/gist';
24+
import { isPresent } from './producers/utils';
2425

2526
function preprocess(raw) {
2627
for (const processor of PROXY_PREPROCESSORS) {
@@ -572,6 +573,20 @@ function lastParse(proxy) {
572573
if (!proxy['tls-fingerprint'] && caStr) {
573574
proxy['tls-fingerprint'] = rs.generateFingerprint(caStr);
574575
}
576+
if (
577+
['shadowsocks'].includes(proxy.type) &&
578+
isPresent(proxy, 'shadow-tls-password')
579+
) {
580+
proxy.plugin = 'shadow-tls';
581+
proxy['plugin-opts'] = {
582+
host: proxy['shadow-tls-sni'],
583+
password: proxy['shadow-tls-password'],
584+
version: proxy['shadow-tls-version'],
585+
};
586+
delete proxy['shadow-tls-sni'];
587+
delete proxy['shadow-tls-password'];
588+
delete proxy['shadow-tls-version'];
589+
}
575590
return proxy;
576591
}
577592

backend/src/core/proxy-utils/parsers/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ function URI_SS() {
128128
}
129129
userInfoStr = content.split('@')[0];
130130
serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
131+
} else if (content.includes('?')) {
132+
const parsed = content.match(/(\?.*)$/);
133+
query = parsed[1];
131134
}
132135

133136
const serverAndPort = serverAndPortArray[1];

0 commit comments

Comments
 (0)