Skip to content

Commit

Permalink
upgrade https-proxy-agent (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Nov 27, 2024
1 parent 1159038 commit 0b568f5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function place_binary(uri, targetDir, opts, callback) {
process.env.npm_config_proxy;
let agent;
if (proxyUrl) {
const ProxyAgent = require('https-proxy-agent');
agent = new ProxyAgent(proxyUrl);
const { HttpsProxyAgent } = require('https-proxy-agent');
agent = new HttpsProxyAgent(proxyUrl);
log.log('download', `proxy agent configured using: "${proxyUrl}"`);
}

Expand Down
39 changes: 33 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"consola": "^3.2.3",
"detect-libc": "^2.0.0",
"https-proxy-agent": "^5.0.0",
"https-proxy-agent": "^7.0.5",
"node-fetch": "^2.6.7",
"nopt": "^8.0.0",
"semver": "^7.5.3",
Expand Down
4 changes: 2 additions & 2 deletions test/proxy-bcrypt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { createUnzip } = require('zlib');
const os = require('os');

const tar = require('tar-fs');
const Agent = require('https-proxy-agent');
const { HttpsProxyAgent } = require('https-proxy-agent');
const fetch = require('node-fetch');
const { rimraf } = require('rimraf');

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

options.agent = new Agent(proxyServer);
options.agent = new HttpsProxyAgent(proxyServer);

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

0 comments on commit 0b568f5

Please sign in to comment.