Skip to content

Instantly share code, notes, and snippets.

@laggingreflex
Created June 13, 2015 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laggingreflex/46da9348f599c6c25ec4 to your computer and use it in GitHub Desktop.
Save laggingreflex/46da9348f599c6c25ec4 to your computer and use it in GitHub Desktop.
connect-restreamer issue: Error: write after end
// 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