Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
http2-proxy
Advanced tools
A simple http/2 & http/1.1 to http/1.1 spec compliant proxy helper.
$ npm install http2-proxy
http2-proxy
requires node v8.5.0 or newer with http2
enabled. See nightly node builds or building node from source. Pass the --expose-http2
option when starting node v8.x.x.
You must pass allowHTTP1: true
to the http2.createServer
or http2.createSecureServer
factory methods.
import http2 from 'http2'
import proxy from 'http2-proxy'
const server = http2.createServer({ allowHTTP1: true })
server.listen(8000)
server.on('request', (req, res) => {
proxy.web(req, res, {
hostname: 'localhost'
port: 9000
}, err => console.error(err, 'proxy error'))
})
server.on('upgrade', (req, socket, head) => {
proxy.ws(req, socket, head, {
hostname: 'localhost'
port: 9000
}, err => console.error(err, 'proxy error'))
})
server.on('request', (req, res) => {
proxy.web(req, res, {
hostname: 'localhost'
port: 9000,
onRes: (req, resHeaders) => helmet({
setHeader (key, val) {
resHeaders[key.trim().toLowerCase()] = val
},
getHeader (key) {
return resHeaders[key.trim().toLowerCase()]
},
removeHeader (key) {
delete resHeaders[key.trim().toLowerCase()]
}
}, () => {})
}, err => console.error(err, 'proxy error'))
})
server.on('request', (req, res) => {
proxy.web(req, res, {
hostname: 'localhost'
port: 9000,
onReq: (req, reqHeaders) => {
reqHeaders['x-forwarded-for'] = req.socket.remoteAddress
reqHeaders['x-forwarded-proto'] = req.socket.encrypted ? 'https' : 'http'
reqHeaders['x-forwarded-host'] = req.headers['host']
}
}, err => console.error(err, 'proxy error'))
})
req
: http.IncomingMessage
or http2.Http2ServerRequest
res
: http.ServerResponse
or http2.Http2ServerResponse
options
: see OptionsonProxyError(err)
: called on errorreq
: http.IncomingMessage
socket
: net.Socket
head
: Buffer
options
: see OptionsonProxyError(err)
: called on errorhostname
: target hostnameport
: target porttimeout
: incoming request timeoutproxyTimeout
: proxy request timeoutproxyName
: proxy name used for Via headeronReq(req, reqHeaders)
: called before proxy requestonRes(req, resHeaders)
: called before proxy responseThe MIT License (MIT)
Copyright (c) 2010 - 2016 Charlie Robbins, Jarrett Cruger & the Contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
A simple http/2 & http/1.1 spec compliant proxy helper for Node.
The npm package http2-proxy receives a total of 21,235 weekly downloads. As such, http2-proxy popularity was classified as popular.
We found that http2-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.