npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

http-forward-host

1.0.0

@mafintosh

npmHomeRepoSnykSocket
Downloads:0
$ npm install http-forward-host
DailyWeeklyMonthlyYearly

http-forward-host

Simple stream proxy that sniffs the HTTP host or x-forwarded-for header and allows you to to forward the stream based on that.

npm install http-forward-host

Usage

const fwd = require('http-forward-host')
const net = require('net') // or tls if you want https

net.createServer(function (sock) {
  fwd(sock, async function (host) {
    // http stream is for the host
    return theStreamYouWantToForwardTo
  })
}).listen(80)

License

Apache-2.0