Skip to content

Instantly share code, notes, and snippets.

@A
Created December 6, 2015 10:07
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 A/a5d4c1375b957903af34 to your computer and use it in GitHub Desktop.
Save A/a5d4c1375b957903af34 to your computer and use it in GitHub Desktop.
var http = require('http'),
express = require('express'),
httpProxy = require('http-proxy'),
url = require('url');
var selects = [];
var simpleselect = {};
simpleselect.query = 'body';
simpleselect.func = function (node) {
var s = '';
var stream = node.createStream();
stream.on('data', function(chunk) { s += chunk.toString(); });
stream.on('end', function() {
stream.end(s + '<script>alert1</script>');
});
}
selects.push(simpleselect);
express()
.use(require('harmon')([], selects))
.use(function (req, res) {
httpProxy
.createProxyServer({ target: url.parse(req.url).protocol + "//" + url.parse(req.url).hostname })
.web(req, res)
})
.use(function(req, res) {
res.send();
})
.listen(8000)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment