0.2.0 • Published 8 years ago

forward-http v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

forward-http

Forward http request to another destination

Usage

Useful for forwarding API calls to backends.

const forward = require('forward-http')
require('http').createServer( (req, res)=>{
    forward('http://destination.url/path?query=1', req, res)
} ).listen(8000)

API

forward(dest, req, res)

dest: destination url

Must use http protocol, forwarding to HTTPS is not supported!
Can contain query string

req/res: http.IncomingMessage/http.ServerResponse

You get these from http.Server's request event
Can be compatible objects (such as spdy.Server's)

Performance

Not tested yet. :(

LICENSE

MIT

0.2.0

8 years ago

0.1.0

8 years ago