Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 46e4ec5

Browse files
Proper proxy-agent initialization
1 parent 8dee4bd commit 46e4ec5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/superagent-proxy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Module dependencies.
66
*/
77

8-
var proxyAgent = require('proxy-agent');
8+
const { ProxyAgent } = require('proxy-agent');
99
// var debug = require('debug')('superagent-proxy');
1010

1111
/**
@@ -70,7 +70,7 @@ function proxy (uri) {
7070
setupUrl(this);
7171

7272
// attempt to get a proxying `http.Agent` instance
73-
var agent = proxyAgent(uri);
73+
var agent = new ProxyAgent({ getProxyForUrl: () => uri });
7474

7575
// if we have an `http.Agent` instance then call the .agent() function
7676
if (agent) this.agent(agent);

0 commit comments

Comments
 (0)