Skip to content

Commit aefe24c

Browse files
committed
upgrade https-proxy-agent
1 parent f2c3ecb commit aefe24c

4 files changed

Lines changed: 64 additions & 15 deletions

File tree

lib/install.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ function place_binary(uri, targetDir, opts, callback) {
5656
process.env.npm_config_proxy;
5757
let agent;
5858
if (proxyUrl) {
59-
const ProxyAgent = require('https-proxy-agent');
60-
agent = new ProxyAgent(proxyUrl);
59+
const { HttpsProxyAgent } = require('https-proxy-agent');
60+
agent = new HttpsProxyAgent(proxyUrl);
6161
log.http('download', 'proxy agent configured using: "%s"', proxyUrl);
6262
}
6363

package-lock.json

Lines changed: 59 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"main": "./lib/node-pre-gyp.js",
2222
"dependencies": {
2323
"detect-libc": "^2.0.0",
24-
"https-proxy-agent": "^5.0.0",
24+
"https-proxy-agent": "^7.0.5",
2525
"make-dir": "^3.1.0",
2626
"node-fetch": "^2.6.7",
2727
"nopt": "^5.0.0",

test/proxy-bcrypt.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { createUnzip } = require('zlib');
66
const os = require('os');
77

88
const tar = require('tar-fs');
9-
const Agent = require('https-proxy-agent');
9+
const { HttpsProxyAgent } = require('https-proxy-agent');
1010
const fetch = require('node-fetch');
1111
const { rimraf } = require('rimraf');
1212

@@ -44,7 +44,7 @@ test('setup proxy server', (t) => {
4444
proxy.startServer({ port: proxyPort });
4545
process.env.https_proxy = process.env.http_proxy = proxyServer;
4646

47-
options.agent = new Agent(proxyServer);
47+
options.agent = new HttpsProxyAgent(proxyServer);
4848

4949
// make sure the download directory deleted then create an empty one
5050
rimraf(downloadDir).then(() => {

0 commit comments

Comments
 (0)