Forward http request to another destination
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)
Must use http protocol, forwarding to HTTPS is not supported!
Can contain query string
You get these from http.Server
's request
event
Can be compatible objects (such as spdy.Server
's)
Not tested yet. :(
MIT