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 0.2.5 to 0.2.6

21

index.js

@@ -270,7 +270,4 @@ const http2 = require('http2')

const fwd = {
by: req.headers[HTTP2_HEADER_AUTHORITY] || req.headers[HTTP2_HEADER_HOST],
proto: req.socket.encrypted ? 'https' : 'http',
for: `for=${req.socket.remoteAddress}`
}
headers[HTTP2_HEADER_FORWARDED] = `by=${req.socket.localAddress}`
headers[HTTP2_HEADER_FORWARDED] += `; for=${req.socket.remoteAddress}`

@@ -284,13 +281,13 @@ if (req.headers[HTTP2_HEADER_FORWARDED]) {

}
fwd.for += `; ${m[1]}`
headers[HTTP2_HEADER_FORWARDED] += `; ${m[1]}`
}
}
headers[HTTP2_HEADER_FORWARDED] = [
`by=${fwd.by}`,
fwd.for,
fwd.host && `host=${fwd.host}`,
`proto=${fwd.proto}`
].filter(x => x).join('; ')
const host = req.headers[HTTP2_HEADER_AUTHORITY] || req.headers[HTTP2_HEADER_HOST]
if (host) {
headers[HTTP2_HEADER_FORWARDED] += `; host=${host}`
}
headers[HTTP2_HEADER_FORWARDED] += `; proto=${req.socket.encrypted ? 'https' : 'http'}`
return headers

@@ -297,0 +294,0 @@ }

{
"name": "http2-proxy",
"version": "0.2.5",
"version": "0.2.6",
"scripts": {

@@ -5,0 +5,0 @@ "dev": "nodemon --inspect=9308 --expose-http2 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