Socket
Socket
Sign inDemoInstall

http2-proxy

Package Overview
Dependencies
0
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.27 to 5.0.28

30

index.js

@@ -26,2 +26,3 @@ const net = require('net')

const kProxySocket = Symbol('proxySocket')
const kConnected = Symbol('connected')
const kOnRes = Symbol('onRes')

@@ -182,2 +183,3 @@

proxyReq[kRes] = res
proxyReq[kConnected] = false
proxyReq[kOnRes] = onRes

@@ -194,4 +196,2 @@

.on('error', onComplete)
.on('data', onRequestData)
.on('end', onRequestEnd)

@@ -203,7 +203,18 @@ proxyReq

.on('upgrade', onProxyReqUpgrade)
.on('drain', onProxyRequestDrain)
deferToConnect.call(proxyReq, onProxyConnect)
return promise
}
function deferToConnect (cb) {
this.once('socket', function (socket) {
if (!socket.connecting) {
cb.call(this)
} else {
socket.once('connect', cb.bind(this))
}
})
}
function onComplete (err) {

@@ -260,2 +271,13 @@ const res = this[kRes]

function onProxyConnect () {
this[kConnected] = true
this[kReq]
.on('data', onRequestData)
.on('end', onRequestEnd)
this
.on('drain', onProxyRequestDrain)
}
function onRequestData (buf) {

@@ -276,3 +298,3 @@ if (!this[kProxyReq].write(buf)) {

function onProxyReqError (err) {
err.statusCode = this.headersSent ? 502 : 503
err.statusCode = this[kConnected] ? 502 : 503
onComplete.call(this, err)

@@ -279,0 +301,0 @@ }

2

package.json
{
"name": "http2-proxy",
"version": "5.0.27",
"version": "5.0.28",
"scripts": {

@@ -5,0 +5,0 @@ "dev": "nodemon --inspect=9308 src"

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc