title: keep-alive connection with Superagent
body: <p>I'm running a node.js server A which uses superagent to issue HTTP requests to another server B.</p>
  <p>I investigated the request on server B and saw the the header <code>connection</code> being <code>close</code> and the httpVersion being <code>1.1</code>:</p>
  <pre><code>var http = require('http');
  var request = require('superagent');
  
  http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.write('req.httpVersion seen on server:' + req.httpVersion);
    res.write('\nreq.headers.connection seen on server:' + req.headers.connection);
    res.end();
  }).listen(1337, '0.0.0.0');
  
  request
    .get('localhost:1337/helloword')
    .end(function (err, res) {
      console.log(res.text);
    });
  </code></pre>
  <p>This leads to:</p>
  <pre><code>req.httpVersion seen on server:1.1
  req.headers.connection seen on server:close
  </code></pre>
  <p>However if I access the same server from a browser I get:</p>
  <pre><code>req.httpVersion seen on server:1.1
  req.headers.connection seen on server:keep-alive
  </code></pre>
  <p>From  <a href="https://www.rfc-editor.org/rfc/rfc2616#page-172" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc2616#page-172</a> I learned that <code>keep-alive</code> is the default for HTTP 1.1 unless declared otherwise by using <code>Connection: close</code>.</p>
  <p>So, my questions are:</p>
  <ul>
  <li>Why does Superagent / Node.js explicitly set the request to not use keep-alive / persistent connections?</li>
  <li>How can I force Superagent / Node.js to use keep-alive connections?</li>
  <li>How can I further influence the exact behaviour (how many connections to keep open, timeouts etc.)?</li>
  </ul>