Skip to content

Commit 2721847

Browse files
committed
test: enable keepAlive on proxy web server
to see if it improves performance. Idea from http-party/node-http-proxy#1058 [docs](https://nodejs.org/api/http.html#new-agentoptions)
1 parent 0bb901a commit 2721847

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/configproxy.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ class ConfigurableProxy extends EventEmitter {
219219
this.metricsServer = http.createServer(metricsCallback);
220220
}
221221

222+
var proxyOptions = {keepAlive: true};
223+
222224
// proxy requests separately
223225
var proxyCallback = logErrors(this.handleProxyWeb);
224226
if (this.options.ssl) {
225-
this.proxyServer = https.createServer(this.options.ssl, proxyCallback);
227+
this.proxyServer = https.createServer({...this.options.ssl, ...proxyOptions}, proxyCallback);
226228
} else {
227-
this.proxyServer = http.createServer(proxyCallback);
229+
this.proxyServer = http.createServer(proxyOptions, proxyCallback);
228230
}
229231
// proxy websockets
230232
this.proxyServer.on("upgrade", bound(this, this.handleProxyWs));

0 commit comments

Comments
 (0)