code: function isKeepalive(req) {
    var conn = req.headers.connection;
    if (typeof(conn) === 'undefined' || conn === null)
      conn = '';
    conn = conn.trim().toLowerCase();
  
    if (/\bclose\b/i.test(conn))
      return false;
    if (/\bkeep-alive\b/i.test(conn))
      return true;
  
    // No Connection header. Default to keepalive for 1.1, non for 1.0.
    if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) {
      return false;
    } else {
      return true;
    }
  }
docs: Determine if keepalive is desired by the client that generated this request