Socket
Socket
Sign inDemoInstall

http2-proxy

Package Overview
Dependencies
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http2-proxy - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

16

index.js

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

proxy.ws = function ws (req, socket, head, options, callback) {
const promise = compat(ctx, options)
const promise = compat({ req, socket, head }, options)
if (!callback) {

@@ -42,3 +42,3 @@ return promise

proxy.web = function web (req, res, options, callback) {
const promise = compat(ctx, options)
const promise = compat({ req, res }, options)
if (!callback) {

@@ -53,2 +53,4 @@ return promise

async function compat (ctx, options) {
const { req, res } = ctx
const {

@@ -71,3 +73,3 @@ hostname,

{ ...ctx, proxyName },
async ureq => {
async ureq => {
ureq.hostname = hostname

@@ -78,5 +80,5 @@ ureq.port = port

if (onReq) {
return await new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
const promise = onReq(req, options, (err, val) => err ? reject(err) : resolve(val))
if (promise.then) {
if (promise && promise.then) {
promise.then(resolve).catch(reject)

@@ -100,4 +102,4 @@ }

return new Promise((resolve, reject) => {
const promise = onRes(req, res, proxyRes, (err, val) => err ? reject(err) : callback(val))
if (promise.then) {
const promise = onRes(req, res, proxyRes, (err, val) => err ? reject(err) : resolve(val))
if (promise && promise.then) {
promise.then(resolve).catch(reject)

@@ -104,0 +106,0 @@ }

{
"name": "http2-proxy",
"version": "5.0.1",
"version": "5.0.2",
"scripts": {

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

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