I\'m trying to do something like this:
// Setup prox to handle blog requests
httpProxy.createServer({
hostnameOnly: true,
router: {
\'http://
A very straightforward solution which works seamlessly, and with cookies/authentication as well, using express-http-proxy
:
var proxy = require('express-http-proxy');
var blogProxy = proxy('localhost/blog:2368', {
forwardPath: function (req, res) {
return require('url').parse(req.url).path;
}
});
And then simply:
app.use("/blog/*", blogProxy);
I know I'm late to join this party, but I hope this helps someone.