Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Commit

Permalink
Merge #5 correct-proxy-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tejohnso committed Mar 14, 2022
2 parents 30327e9 + 3819a51 commit 27e9a1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -107,7 +109,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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 27e9a1d

Please sign in to comment.