From 0d9078702390aa8bd0efc2941b274b2b64674226 Mon Sep 17 00:00:00 2001 From: Ali Kesht Kar <35303148+AliKeshtKarORG@users.noreply.github.com> Date: Thu, 11 Feb 2021 11:38:44 +0330 Subject: [PATCH 1/2] add proxy vars --- src/main/config.default.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/config.default.json b/src/main/config.default.json index 35a750d..f86ff05 100644 --- a/src/main/config.default.json +++ b/src/main/config.default.json @@ -8,5 +8,14 @@ "quality": 1, "directory": null, "library": [] + }, + "proxy": { + "protocol": null, + "host": null, + "port": null, + "auth": { + "username": null, + "password": null + } } -} \ No newline at end of file +} From ab4b25f54535eeb6885698bd174903922ba7693b Mon Sep 17 00:00:00 2001 From: Ali Kesht Kar <35303148+AliKeshtKarORG@users.noreply.github.com> Date: Thu, 11 Feb 2021 11:40:20 +0330 Subject: [PATCH 2/2] add proxy var to axios requests --- src/main/api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/api.js b/src/main/api.js index f254db4..8f3195a 100644 --- a/src/main/api.js +++ b/src/main/api.js @@ -6,6 +6,7 @@ async function sendRequest(action = "GET", method, body) { let apiToken = Store.get("deezer.apiToken"); let sessionId = Store.get("deezer.sessionId"); + let proxyConfig = Store.get("proxy"); try { // Send request let response = await Axios.request({ @@ -14,7 +15,8 @@ async function sendRequest(action = "GET", method, body) { Cookie: `sid=${sessionId};` }, method: action, - data: body + data: body, + proxy: proxyConfig }); return response; @@ -145,4 +147,4 @@ export default { sendAutocompleteRequest, sendSearchRequest, testConnection -} \ No newline at end of file +}