Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-https-proxy-agent

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-https-proxy-agent - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

174

index.js

@@ -119,34 +119,7 @@ 'use strict';

stream.setTimeout = function surrogateSetTimeout(timeout, callback) {
this.surrogateTimeout = timeout;
stream.setTimeout = surrogateSetTimeout;
stream.setKeepAlive = surrogateSetKeepAlive;
stream.ref = surrogateRef;
stream.unref = surrogateUnref;
this.setTimeoutListener(timeout, callback);
return this;
};
stream.setKeepAlive = function surrogateSetKeepAlive(enable, initialDelay) {
if (typeof enable === 'boolean') {
this.surrogateKeepAliveEnable = enable;
} else {
initialDelay = enable;
}
if (initialDelay) this.surrogateKeepAliveDelay = initialDelay;
return this;
};
stream.ref = function surrogateRef() {
this.surrogateReffed = true;
return this;
};
stream.unref = function surrogateUnref() {
this.surrogateReffed = false;
return this;
};
/*

@@ -156,16 +129,4 @@ * Utility method used both before and after the surrogate stream is connected.

stream.setTimeoutListener = function setTimeoutListener(timeout, callback) {
if (timeout) {
if (callback) this.once('timeout', callback);
return;
}
stream.setTimeoutListener = setTimeoutListener;
if (callback) {
this.removeListener('timeout', callback);
return;
}
this.removeAllListeners('timeout');
};
return stream;

@@ -203,28 +164,7 @@ };

stream.setTimeout = function connectedSetTimeout(timeout, callback) {
this.surrogateConnectedStream.setTimeout(timeout);
stream.setTimeout = connectedSetTimeout;
stream.setKeepAlive = connectedSetKeepAlive;
stream.ref = connectedRef;
stream.unref = connectedUnref;
this.setTimeoutListener(timeout, callback);
return this;
};
stream.setKeepAlive = function connectedSetKeepAlive(enable, initialDelay) {
this.surrogateConnectedStream.setKeepAlive(enable, initialDelay);
return this;
}
stream.ref = function connectedRef() {
this.surrogateConnectedStream.ref();
return this;
}
stream.unref = function connectedUnef() {
this.surrogateConnectedStream.unref();
return this;
}
/*

@@ -235,5 +175,3 @@ * Forward the 'timeout' event, as it is not a standard stream event.

*/
tlsSocket.on('timeout', function onTimeout() {
this.surrogateStream.emit('timeout')
});
tlsSocket.on('timeout', connectedOnTimeout);

@@ -249,8 +187,4 @@ /*

*/
tlsSocket.once('end', function connectedOnEnd() {
this.surrogateSeenEnd = true;
});
tlsSocket.once('close', function connectedOnClose() {
if (this.surrogateSeenEnd) this.surrogateStream.emit('close');
});
tlsSocket.once('end', connectedOnEnd);
tlsSocket.once('close', connectedOnClose);
};

@@ -284,2 +218,86 @@

function surrogateSetTimeout(timeout, callback) {
this.surrogateTimeout = timeout;
this.setTimeoutListener(timeout, callback);
return this;
}
function surrogateSetKeepAlive(enable, initialDelay) {
if (typeof enable === 'boolean') {
this.surrogateKeepAliveEnable = enable;
} else {
initialDelay = enable;
}
if (initialDelay) this.surrogateKeepAliveDelay = initialDelay;
return this;
}
function surrogateRef() {
this.surrogateReffed = true;
return this;
}
function surrogateUnref() {
this.surrogateReffed = false;
return this;
}
function setTimeoutListener(timeout, callback) {
if (timeout) {
if (callback) this.once('timeout', callback);
return;
}
if (callback) {
this.removeListener('timeout', callback);
return;
}
this.removeAllListeners('timeout');
}
function connectedSetTimeout(timeout, callback) {
this.surrogateConnectedStream.setTimeout(timeout);
this.setTimeoutListener(timeout, callback);
return this;
}
function connectedSetKeepAlive(enable, initialDelay) {
this.surrogateConnectedStream.setKeepAlive(enable, initialDelay);
return this;
}
function connectedRef() {
this.surrogateConnectedStream.ref();
return this;
}
function connectedUnref() {
this.surrogateConnectedStream.unref();
return this;
}
function connectedOnTimeout() {
this.surrogateStream.emit('timeout')
}
function connectedOnEnd() {
this.surrogateSeenEnd = true;
}
function connectedOnClose() {
if (this.surrogateSeenEnd) this.surrogateStream.emit('close');
}
module.exports.Agent = Agent;
{
"name": "better-https-proxy-agent",
"version": "1.0.4",
"version": "1.0.5",
"description": "An agent for HTTPS through an HTTP(S) proxy server using the CONNECT method",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc