From ca5bfe4948426287d1a13535ad9a0bab2859bee6 Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Fri, 11 Mar 2022 17:06:20 -0500 Subject: [PATCH 1/3] Don't use deprecated resolveProxy callback method --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 6a76d41..eef0831 100644 --- a/index.js +++ b/index.js @@ -107,7 +107,7 @@ function connect (req, opts, fn) { } debug('url: %o', url); - self.session.resolveProxy(url, onproxy); + self.session.resolveProxy(url).then(onproxy); // `resolveProxy()` callback function function onproxy (proxy) { From f8cc634c6cc7472f99a60894b9fb38be7dc9d053 Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Fri, 11 Mar 2022 17:08:20 -0500 Subject: [PATCH 2/3] Update use of agent-base --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index eef0831..a9b2f5d 100644 --- a/index.js +++ b/index.js @@ -56,15 +56,17 @@ function ElectronProxyAgent(session, username, password) { } } - Agent.call(this, connect); + instance = Agent.call(this, connect); - this.session = session; + instance.session = session; - this.cache = this._resolver = null; - this.credentials = { + instance.cache = instance._resolver = null; + instance.credentials = { username: username, password: password }; + + return instance; } inherits(ElectronProxyAgent, Agent); From 3819a51f2e819d76d0afdfe340a26e5c18a6b200 Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Fri, 11 Mar 2022 17:09:06 -0500 Subject: [PATCH 3/3] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d05caa..8b9aa50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron-proxy-agent", - "version": "2.0.0", + "version": "2.0.1", "description": "NodeJS http(s).Agent implementation for electron shell", "main": "index.js", "repository": {