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.7 to 1.0.8

25

index.js

@@ -113,3 +113,8 @@ 'use strict';

Agent.prototype._createSurrogateStream = function _createSurrogateStream(destroyer) {
const stream = duplexify();
const stream = duplexify(null, null, {
/*
* Don't end the writable stream when the readable stream ends.
*/
end: false
});

@@ -188,12 +193,10 @@ stream.surrogateConnectedStream = null;

* writable streams emits an error or close it will destroy both streams and
* bubble up the event," on careful examination, `close` events only bubble
* up and destroy the stream if they are 'premature', which means they occur
* before an expected `end` event; `close` events are also emitted by the
* 'duplexify' stream following an error. However, following an 'end' event,
* no 'close' is emitted at all. Oops. We work around that problem here.
* bubble up the event," this does not appear to be reliable, but I have been
* unable to reproduce the situation using mocks. Propagate the events ourselves
* to be safe.
*
* It also doesn't set writable to false when the stream is closed, even
* 'duplexify' also doesn't set writable to false when the stream is closed, even
* though it is no longer safe to call write(). We deal with that, too.
*/
tlsSocket.once('end', connectedOnEnd);
tlsSocket.once('error', connectedOnError);
tlsSocket.once('close', connectedOnClose);

@@ -334,4 +337,4 @@ };

function connectedOnEnd() {
this.surrogateSeenEnd = true;
function connectedOnError(error) {
this.surrogateStream.emit('error', error);
}

@@ -341,5 +344,5 @@

this.surrogateStream.writable = false;
if (this.surrogateSeenEnd) this.surrogateStream.emit('close');
this.surrogateStream.emit('close');
}
module.exports.Agent = Agent;
{
"name": "better-https-proxy-agent",
"version": "1.0.7",
"version": "1.0.8",
"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