Created by: jwalton
This is an alternative fix for #570 (closed) (see my other pr #572).
The idea here is that if no agent is specified, we explicitly set keepAlive to false.
If keepAlive is true, then every time we proxy a request we will create a new connection (because there is no agent managing a pool of connections), but with keepAlive set, node.js will not kill the connection after we make a request. The connection will stay open (potentially for several minutes) eating up a file descriptor.
With keepAlive set false, node.js will close the connection for us after the request is made, cleaning up the resources immediately. Under heavy load, this will result in far more connections than in PR #572, but may or may not result in better performance overall. When heavy load clears, however, the connection count will drop back down immediately.
Note that, with or without this fix, connections are not being reused - all this does is clean up connections after we're done with them. Also not that in node v0.11.11, this option is implicitly set for us when node assigns us an agent.