mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 06:09:00 +08:00
尝试增加 SSD 支持。
This commit is contained in:
parent
9fcea60555
commit
568b2a1460
@ -665,6 +665,32 @@ function ProxyParser(targetPlatform) {
|
|||||||
raw = raw.replace(/ -\n.*name/g, " - name");
|
raw = raw.replace(/ -\n.*name/g, " - name");
|
||||||
const proxies = YAML.eval(raw).proxies;
|
const proxies = YAML.eval(raw).proxies;
|
||||||
output = proxies.map((p) => JSON.stringify(p));
|
output = proxies.map((p) => JSON.stringify(p));
|
||||||
|
} else if (raw.indexOf("ssd://") == 0) {
|
||||||
|
output = [];
|
||||||
|
const Base64 = new Base64Code();
|
||||||
|
let ssdinfo = JSON.parse(Base64.safeDecode(raw.split("ssd://")[1]));
|
||||||
|
// options (traffic_used, traffic_total, expiry, url)
|
||||||
|
let traffic_used = ssdinfo.traffic_used; // GB
|
||||||
|
let traffic_total = ssdinfo.traffic_total; // GB, -1 means unlimited
|
||||||
|
let expiry = ssdinfo.expiry; // YYYY-MM-DD HH:mm:ss
|
||||||
|
// default setting
|
||||||
|
let name = ssdinfo.airport; // name of the airport
|
||||||
|
let port = ssdinfo.port;
|
||||||
|
let method = ssdinfo.encryption;
|
||||||
|
let password = ssdinfo.password;
|
||||||
|
// servers config
|
||||||
|
let servers = ssdinfo.servers;
|
||||||
|
for (let i = 0; i < servers.length; i++) {
|
||||||
|
let server = servers[i];
|
||||||
|
method = server.encryption ? server.encryption : method;
|
||||||
|
password = server.password ? server.password : password;
|
||||||
|
let userinfo = Base64.safeEncode(method + ":" + password);
|
||||||
|
let hostname = server.server;
|
||||||
|
port = server.port ? server.port : port;
|
||||||
|
let tag = server.remarks ? server.remarks : i;
|
||||||
|
let plugin = server.plugin_options ? "/?" + encodeURIComponent(server.plugin + ";" + server.plugin_options) : ""
|
||||||
|
output[i] = "ss://" + userinfo + "@" + hostname + ":" + port + plugin + "#" + tag
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// check if content is based64 encoded
|
// check if content is based64 encoded
|
||||||
const Base64 = new Base64Code();
|
const Base64 = new Base64Code();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user