Created
June 13, 2015 05:45
-
-
Save laggingreflex/46da9348f599c6c25ec4 to your computer and use it in GitHub Desktop.
connect-restreamer issue: Error: write after end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/dominictarr/connect-restreamer/issues/8 | |
var express = require('express'); | |
var app = module.exports = express(); | |
var connectRestreamer = require('connect-restreamer'); | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); | |
app.use(bodyParser.json()); | |
app.use(connectRestreamer()); | |
var proxy = require('http-proxy').createProxyServer({ | |
host: 'http://testwp', | |
// port: 8983 | |
}); | |
app.use('/blog', function(req, res, next) { | |
// req.url = req.url.slice(5); | |
proxy.web(req, res, { | |
target: 'http://testwp' | |
}, next); | |
}); | |
app.listen(80, function(){ | |
console.log('Listening!'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment