diff --git a/package-lock.json b/package-lock.json index c353f605263..73733dfd924 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1646,6 +1646,7 @@ }, "node_modules/@tootallnate/once": { "version": "2.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">= 10" @@ -4640,6 +4641,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, "dependencies": { "@tootallnate/once": "2", "agent-base": "6", @@ -9399,7 +9401,7 @@ "dependencies": { "debug": "4.3.4", "extract-zip": "2.0.1", - "http-proxy-agent": "5.0.0", + "http-proxy-agent": "6.0.1", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", @@ -9431,6 +9433,29 @@ "dev": true, "license": "MIT" }, + "packages/browsers/node_modules/agent-base": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.0.1.tgz", + "integrity": "sha512-V9to8gr2GK7eA+xskWGAFUX/TLSQKuH2TI06c/jGLL6yLp3oEjtnqM7a5tPV9fC1rabLeAgThZeBwsYX+WWHpw==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "packages/browsers/node_modules/http-proxy-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-6.0.1.tgz", + "integrity": "sha512-rD8wrfJHbnVll9lkIpQH3vDbKON1Ssciggwydom/r89HLBXEqdMhL6wx7QF5WePDPSr0OdoztdXoojbrXadG5Q==", + "dependencies": { + "agent-base": "^7.0.1", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "packages/ng-schematics": { "name": "@puppeteer/ng-schematics", "version": "0.2.0", @@ -10520,7 +10545,7 @@ "@types/yargs": "17.0.22", "debug": "4.3.4", "extract-zip": "2.0.1", - "http-proxy-agent": "5.0.0", + "http-proxy-agent": "6.0.1", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", @@ -10532,6 +10557,23 @@ "@types/node": { "version": "14.18.36", "dev": true + }, + "agent-base": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.0.1.tgz", + "integrity": "sha512-V9to8gr2GK7eA+xskWGAFUX/TLSQKuH2TI06c/jGLL6yLp3oEjtnqM7a5tPV9fC1rabLeAgThZeBwsYX+WWHpw==", + "requires": { + "debug": "^4.3.4" + } + }, + "http-proxy-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-6.0.1.tgz", + "integrity": "sha512-rD8wrfJHbnVll9lkIpQH3vDbKON1Ssciggwydom/r89HLBXEqdMhL6wx7QF5WePDPSr0OdoztdXoojbrXadG5Q==", + "requires": { + "agent-base": "^7.0.1", + "debug": "^4.3.4" + } } } }, @@ -10740,7 +10782,8 @@ "dev": true }, "@tootallnate/once": { - "version": "2.0.0" + "version": "2.0.0", + "dev": true }, "@tsconfig/node10": { "version": "1.0.9", @@ -12701,6 +12744,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, "requires": { "@tootallnate/once": "2", "agent-base": "6", diff --git a/packages/browsers/package.json b/packages/browsers/package.json index 205ec4c38f2..f2cea623b1a 100644 --- a/packages/browsers/package.json +++ b/packages/browsers/package.json @@ -99,7 +99,7 @@ "dependencies": { "debug": "4.3.4", "extract-zip": "2.0.1", - "http-proxy-agent": "5.0.0", + "http-proxy-agent": "6.0.1", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", diff --git a/packages/browsers/src/httpUtil.ts b/packages/browsers/src/httpUtil.ts index 966b9475901..34aa3f895d8 100644 --- a/packages/browsers/src/httpUtil.ts +++ b/packages/browsers/src/httpUtil.ts @@ -19,10 +19,13 @@ import * as http from 'http'; import * as https from 'https'; import {URL} from 'url'; -import createHttpProxyAgent from 'http-proxy-agent'; -import createHttpsProxyAgent from 'https-proxy-agent'; +import * as httpProxyAgent from 'http-proxy-agent'; +import * as httpsProxyAgent from 'https-proxy-agent'; import {getProxyForUrl} from 'proxy-from-env'; +const {HttpProxyAgent} = httpProxyAgent; +const {HttpsProxyAgent} = httpsProxyAgent; + export function headHttpRequest(url: URL): Promise { return new Promise(resolve => { const request = httpRequest( @@ -58,9 +61,9 @@ export function httpRequest( if (proxyURL) { const proxy = new URL(proxyURL); if (proxy.protocol === 'http:') { - options.agent = createHttpProxyAgent(proxyURL); + options.agent = new HttpProxyAgent(proxyURL); } else { - options.agent = createHttpsProxyAgent({ + options.agent = new HttpsProxyAgent({ host: proxy.host, path: proxy.pathname, port: proxy.port,