https-proxy-agent
Advanced tools
Comparing version 6.2.1 to 7.0.0
@@ -50,5 +50,2 @@ "use strict"; | ||
class HttpsProxyAgent extends agent_base_1.Agent { | ||
get secureProxy() { | ||
return isHTTPS(this.proxy.protocol); | ||
} | ||
constructor(proxy, opts) { | ||
@@ -64,3 +61,3 @@ super(opts); | ||
? parseInt(this.proxy.port, 10) | ||
: this.secureProxy | ||
: this.proxy.protocol === 'https:' | ||
? 443 | ||
@@ -81,3 +78,3 @@ : 80; | ||
async connect(req, opts) { | ||
const { proxy, secureProxy } = this; | ||
const { proxy } = this; | ||
if (!opts.host) { | ||
@@ -88,3 +85,3 @@ throw new TypeError('No "host" provided'); | ||
let socket; | ||
if (secureProxy) { | ||
if (proxy.protocol === 'https:') { | ||
debug('Creating `tls.Socket`: %o', this.connectOpts); | ||
@@ -167,5 +164,2 @@ socket = tls.connect(this.connectOpts); | ||
} | ||
function isHTTPS(protocol) { | ||
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; | ||
} | ||
function omit(obj, ...keys) { | ||
@@ -172,0 +166,0 @@ const ret = {}; |
@@ -38,3 +38,2 @@ /// <reference types="node" /> | ||
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions; | ||
get secureProxy(): boolean; | ||
constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>); | ||
@@ -41,0 +40,0 @@ /** |
@@ -50,5 +50,2 @@ "use strict"; | ||
class HttpsProxyAgent extends agent_base_1.Agent { | ||
get secureProxy() { | ||
return isHTTPS(this.proxy.protocol); | ||
} | ||
constructor(proxy, opts) { | ||
@@ -64,3 +61,3 @@ super(opts); | ||
? parseInt(this.proxy.port, 10) | ||
: this.secureProxy | ||
: this.proxy.protocol === 'https:' | ||
? 443 | ||
@@ -81,3 +78,3 @@ : 80; | ||
async connect(req, opts) { | ||
const { proxy, secureProxy } = this; | ||
const { proxy } = this; | ||
if (!opts.host) { | ||
@@ -88,3 +85,3 @@ throw new TypeError('No "host" provided'); | ||
let socket; | ||
if (secureProxy) { | ||
if (proxy.protocol === 'https:') { | ||
debug('Creating `tls.Socket`: %o', this.connectOpts); | ||
@@ -167,5 +164,2 @@ socket = tls.connect(this.connectOpts); | ||
} | ||
function isHTTPS(protocol) { | ||
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; | ||
} | ||
function omit(obj, ...keys) { | ||
@@ -172,0 +166,0 @@ const ret = {}; |
{ | ||
"name": "https-proxy-agent", | ||
"version": "6.2.1", | ||
"version": "7.0.0", | ||
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34399
494