mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-07-30 08:02:00 +08:00
feat: 支持 Shadowrocket Shadowsocks 输入中的 Shadow TLS 参数
This commit is contained in:
parent
95d6688539
commit
4a07c02dc1
@ -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": {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user