title: Node.js progress indicator feedback
body: <p>I have a question about the progress of sending with Node.js 'request'. I have a Node.js application that acts as a proxy, actually forwarding a body to another server. I want to see the progress of this upload action. Now I am doing this:</p>
  
  <pre><code>BROWSER 
     -&gt; UPLOAD TO NODE 
     -&gt; UPLOAD TO 3rd PARTY SERVICE 
     -&gt; RETURN 3rd PARTY RESPONSE TO BROWSER
  </code></pre>
  
  <p>If this is possible, I would log it to check in the console.log how much progress is done. But, would it also be possible to return a </p>
  
  <pre><code>res.send(progress)
  </code></pre>
  
  <p>in the mean time, while waiting for the upload to finish and send the client back the upload has succeeded?</p>
  
  <pre><code>BROWSER 
     -&gt; UPLOAD TO NODE
     -&gt; UPLOAD TO 3rd PARTY SERVICE 
         -&gt; RETURN progress &lt;- 
         -&gt; RETURN progress &lt;- 
         ...etc.
     -&gt; RETURN 3rd PARTY RESPONSE TO BROWSER
  </code></pre>
  
  <p>This is the upload code (pretty much straightforward). </p>
  
  <pre><code>var requestOptions = {
      timeout: 120000,
      url: url, //URL to hit
      method: 'post',
      headers: headers,
      body: payload //Set the body as a string
  };
  
  
  request(requestOptions, function (error, response, body) {
      if (error) {
          res.send(error);
      }
      else {
          //res.sendStatus(response.statusCode);
          console.log("[RETURNING RESPONSE BODY]");
          res.send(body);
      }
  });
  </code></pre>