Socket
Socket
Sign inDemoInstall

https-proxy-agent

Package Overview
Dependencies
3
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.2.1 to 7.0.0

12

./dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc