http-forward

0.1.3 • Public • Published

http-forward Build Status NPM

Simple proxy forward for incoming HTTP requets. Built for node.js/io.js.

Installation

npm install http-forward

API

const http = require('http')
const forward = require('http-forward')
 
var server = http.createServer(function (req, res) {
  // Define proxy config params
  req.forward = { target: 'http://new.server.net' }
  forward(req, res)
})
 
server.listen(3000)

forward(req, res, callback)

  • req http.IncomingMessage - Required
  • res http.OutgoingMessage - Required
  • callback function(err, res) - Optional callback

License

MIT - Tomas Aparicio

Package Sidebar

Install

npm i http-forward

Weekly Downloads

92

Version

0.1.3

License

MIT

Last publish

Collaborators

  • h2non