From b49baa2f80fd35f88793529a3b71f053e02a6006 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:02:08 -0800 Subject: [PATCH] upgrade https-proxy-agent --- lib/install.js | 4 ++-- package-lock.json | 39 +++++++++++++++++++++++++++++++++------ package.json | 2 +- test/proxy-bcrypt.test.js | 4 ++-- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/lib/install.js b/lib/install.js index 827a2bbd7..94f850db9 100644 --- a/lib/install.js +++ b/lib/install.js @@ -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.http('download', 'proxy agent configured using: "%s"', proxyUrl); } diff --git a/package-lock.json b/package-lock.json index 6b78578ac..4834c86f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "BSD-3-Clause", "dependencies": { "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", + "https-proxy-agent": "^7.0.5", "node-fetch": "^2.6.7", "nopt": "^7.2.1", "npmlog": "^7.0.1", @@ -1255,6 +1255,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -3384,16 +3385,28 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "license": "MIT", "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" } }, "node_modules/ieee754": { @@ -5849,6 +5862,20 @@ "node": ">=10" } }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", diff --git a/package.json b/package.json index f3369141a..64c38ab95 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", + "https-proxy-agent": "^7.0.5", "node-fetch": "^2.6.7", "nopt": "^7.2.1", "npmlog": "^7.0.1", diff --git a/test/proxy-bcrypt.test.js b/test/proxy-bcrypt.test.js index b13818ed0..72c43c4aa 100644 --- a/test/proxy-bcrypt.test.js +++ b/test/proxy-bcrypt.test.js @@ -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'); @@ -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(() => {