var httpProxy = require('http-proxy')
;
httpProxy.createServer(options, function(req, res, proxy) {
if(req.headers.host === '
whatever.example.com') {
proxy.proxyRequest(req, res,
{ host: 'localhost'
, port: '8080'
}
)
return
}
res.writeHead(400, {})
res.write('Bad Request: Missing "Host"')
res.end()
})
- o
> --
> Job Board:
http://jobs.nodejs.org/
> Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to
nod...@googlegroups.com
> To unsubscribe from this group, send email to
>
nodejs+un...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/nodejs?hl=en?hl=en
--
Oliver Leics @ G+
https://plus.google.com/112912441146721682527