title: Node.js request web page
body: <p>I need to connect to a web page and return the status code of the page, which I've been able to achieve using <code>http.request</code> however the pages I need to request can take a long time, sometimes several minutes, so I'm always getting a <code>socket hang up</code> error.</p>
  
  <p>I'm using the following code so far:</p>
  
  <pre><code>var reqPage = function(urlString, cb) {
      // Resolve the URL
      var path = url.parse(urlString);
      var req = http.request({
          host: path.hostname,
          path: path.pathname,
          port: 80,
          method: 'GET'
      });
      req.on('end', function() {
          cb.call(this, res);
      });
      req.on('error', function(e) {
          winston.error(e.message);
      });
  };
  </code></pre>
  
  <p>What do I need to do to ensure that my application still attempts to connect to the page even if it's going to take a few minutes?</p>