title: nodejs socket hang up timeout
body: <p>It's essentially a timeout error for a long running process (about 30 minutes).</p>
  
  <p>how can I increase the timeout for the request? I've tried <code>request.setTimeout(0, console.log);</code> but it's not having any effect on it. </p>
  
  <pre><code>var request = http.request({
      hostname: 'localhost',
      method: 'POST',
      port: 3000,
      headers: {
          'accept': 'application/json;charset=UTF-8',
      }
  }, function(response){
      var body;
      var buffers = [];
      response.on('data', buffers.push.bind(buffers));
      response.on('end', function(){
          try {
              body = Buffer.concat(buffers).toString();
          } catch(error) {console.error(body)}
      });
  }).on('error', function(error){ // errors caught in here
      console.error("http error");
      console.error(error);
  });
  
  request.setTimeout(0, console.log);
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>{ Error: socket hang up
      at createHangUpError (_http_client.js:323:15)
      at Socket.socketOnEnd (_http_client.js:426:23)
      at Socket.emit (events.js:194:15)
      at endReadableNT (_stream_readable.js:1103:12)
      at process._tickCallback (internal/process/next_tick.js:63:19) code: 'ECONNRESET' }
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p><a href="https://i.stack.imgur.com/kXjHt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kXjHt.png" alt="enter image description here"></a></p>
  
  <p><strong>Screenshot 2</strong></p>
  
  <p>The culprit is Formidable on the server end and is throwing aborted error</p>
  
  <p><a href="https://i.stack.imgur.com/9RwY1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9RwY1.png" alt="enter image description here"></a></p>