From 568b2a146050ea87732348465ab6d3ef5e0f44cf Mon Sep 17 00:00:00 2001 From: zZPiglet Date: Sat, 5 Sep 2020 20:07:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=A2=9E=E5=8A=A0=20SSD?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sub-store.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/backend/sub-store.js b/backend/sub-store.js index 79efa2c..eed8344 100644 --- a/backend/sub-store.js +++ b/backend/sub-store.js @@ -665,6 +665,32 @@ function ProxyParser(targetPlatform) { raw = raw.replace(/ -\n.*name/g, " - name"); const proxies = YAML.eval(raw).proxies; 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 { // check if content is based64 encoded const Base64 = new Base64Code(); From e25c83368e33756f0689236085993f6bb172b385 Mon Sep 17 00:00:00 2001 From: zZPiglet Date: Sun, 6 Sep 2020 01:05:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20localhost=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/config.js b/web/src/config.js index 0655575..3a957a9 100644 --- a/web/src/config.js +++ b/web/src/config.js @@ -1,2 +1,2 @@ const DEBUG = process.env.NODE_ENV === "development"; -export const BACKEND_BASE = DEBUG ? `http://192.168.1.134:3000` : `https://sub.store`; \ No newline at end of file +export const BACKEND_BASE = DEBUG ? `http://localhost:3000` : `https://sub.store`; \ No newline at end of file From 4a57b30f7175287469d6dfa3e9698891557a360c Mon Sep 17 00:00:00 2001 From: zZPiglet Date: Sun, 6 Sep 2020 02:13:03 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20ssd=20plugin=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sub-store.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/sub-store.js b/backend/sub-store.js index eed8344..31d4e83 100644 --- a/backend/sub-store.js +++ b/backend/sub-store.js @@ -670,11 +670,11 @@ function ProxyParser(targetPlatform) { 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 + var traffic_used = ssdinfo.traffic_used; // GB + var traffic_total = ssdinfo.traffic_total; // GB, -1 means unlimited + var expiry = ssdinfo.expiry; // YYYY-MM-DD HH:mm:ss // default setting - let name = ssdinfo.airport; // name of the airport + var name = ssdinfo.airport; // name of the airport let port = ssdinfo.port; let method = ssdinfo.encryption; let password = ssdinfo.password; @@ -688,7 +688,7 @@ function ProxyParser(targetPlatform) { 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) : "" + let plugin = server.plugin_options ? "/?plugin=" + encodeURIComponent(server.plugin + ";" + server.plugin_options) : "" output[i] = "ss://" + userinfo + "@" + hostname + ":" + port + plugin + "#" + tag } } else {