Keep-alive broken if target server sends `Connection: close`
Created by: Rush
https://github.com/nodejitsu/node-http-proxy/blob/master/lib/http-proxy/passes/web-outgoing.js#L45
Without agent specified:
Browser <-> Proxy - connects with keep-alive
Proxy <-> Target server - connects without keep-alive
If target server sends Connection: close
the first keep-alive connection is broken.
Maybe better logic would be to do by default:
proxyRes.headers.connection = 'keep-alive';
Other option is to simply always use the agent with keepAlive: true
which was implemented in Node 0.12 - but as I understand, this would be much more resource hungry.