http-proxy-agent
Advanced tools
Comparing version 6.1.1 to 7.0.0
@@ -36,5 +36,2 @@ "use strict"; | ||
const debug = (0, debug_1.default)('http-proxy-agent'); | ||
function isHTTPS(protocol) { | ||
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; | ||
} | ||
/** | ||
@@ -45,5 +42,2 @@ * The `HttpProxyAgent` implements an HTTP Agent subclass that connects | ||
class HttpProxyAgent extends agent_base_1.Agent { | ||
get secureProxy() { | ||
return isHTTPS(this.proxy.protocol); | ||
} | ||
constructor(proxy, opts) { | ||
@@ -58,3 +52,3 @@ super(opts); | ||
? parseInt(this.proxy.port, 10) | ||
: this.secureProxy | ||
: this.proxy.protocol === 'https:' | ||
? 443 | ||
@@ -128,3 +122,3 @@ : 80; | ||
let socket; | ||
if (this.secureProxy) { | ||
if (this.proxy.protocol === 'https:') { | ||
debug('Creating `tls.Socket`: %o', this.connectOpts); | ||
@@ -131,0 +125,0 @@ socket = tls.connect(this.connectOpts); |
@@ -37,3 +37,2 @@ /// <reference types="node" /> | ||
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions; | ||
get secureProxy(): boolean; | ||
constructor(proxy: Uri | URL, opts?: HttpProxyAgentOptions<Uri>); | ||
@@ -40,0 +39,0 @@ addRequest(req: HttpProxyAgentClientRequest, opts: AgentConnectOpts): void; |
@@ -36,5 +36,2 @@ "use strict"; | ||
const debug = (0, debug_1.default)('http-proxy-agent'); | ||
function isHTTPS(protocol) { | ||
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; | ||
} | ||
/** | ||
@@ -45,5 +42,2 @@ * The `HttpProxyAgent` implements an HTTP Agent subclass that connects | ||
class HttpProxyAgent extends agent_base_1.Agent { | ||
get secureProxy() { | ||
return isHTTPS(this.proxy.protocol); | ||
} | ||
constructor(proxy, opts) { | ||
@@ -58,3 +52,3 @@ super(opts); | ||
? parseInt(this.proxy.port, 10) | ||
: this.secureProxy | ||
: this.proxy.protocol === 'https:' | ||
? 443 | ||
@@ -128,3 +122,3 @@ : 80; | ||
let socket; | ||
if (this.secureProxy) { | ||
if (this.proxy.protocol === 'https:') { | ||
debug('Creating `tls.Socket`: %o', this.connectOpts); | ||
@@ -131,0 +125,0 @@ socket = tls.connect(this.connectOpts); |
{ | ||
"name": "http-proxy-agent", | ||
"version": "6.1.1", | ||
"version": "7.0.0", | ||
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", | ||
@@ -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
24333
334