title: How to modify node js response
body: <p>I'm using node js as a proxy for rest services which use NTLM authentication.
  I use <code>httpntlm</code> module to bypass NTLM authentication. This module makes additional request and returns a response.</p>
  
  <p>How can I write NTLM response data to original response?</p>
  
  <pre><code>var httpntlm = require('httpntlm');
  var request = require('request');
  
  app.use(function (req, res, next) {
      httpntlm.post({
          url: url,
          username: username,
          password: password,
          workstation: '',
          domain: domain,
          json: req.body
      }, function (err, ntlmRes) {
  
          // console.log(ntlmRes.statusCode);
          // console.log(ntlmRes.body);
  
          res.body = ntlmRes.body;
          res.status = ntlmRes.statusCode;
  
          next();
          // req.pipe(res);
      });
  });
  </code></pre>