I created a proxy server in node.js using the node-http-proxy module.
Looks like this:
var http = require('http'), httpProxy = require('http-proxy'), io = require("socket.io").listen(5555); var proxy = new httpProxy.RoutingProxy(); http.createServer(function (req, res) { proxy.proxyRequest(req, res, { host: 'localhost', port: 1338 }); }).listen(9000); So, I need, before sending the response back to the client to get the body from the server that I proxy and analyze it.
But I can't find event or attribute, where I can get this data. I tried:
proxy.on('end', function (data) { console.log('end'); }); But I can't figure our how to get the mime body from it.