Skip to content

Commit 28e4231

Browse files
add connection=keep-alive
1 parent 37fd6d8 commit 28e4231

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/proxy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ Proxy.prototype._onHttpServerConnect = function(req, socket, head) {
266266
socket.once('data', self._onHttpServerConnect.bind(self, req, socket));
267267
socket.write('HTTP/1.1 200 OK\r\n');
268268
if (self.keepAlive && req.headers['proxy-connection'] === 'keep-alive') {
269-
socket.write('Proxy-Connection: Keep-Alive\r\n');
269+
socket.write('Proxy-Connection: keep-alive\r\n');
270+
socket.write('Connection: keep-alive\r\n');
270271
}
271272
return socket.write('\r\n');
272273
}
@@ -712,6 +713,7 @@ Proxy.prototype._onHttpServerRequest = function(isSSL, clientToProxyRequest, pro
712713
if (self.keepAlive) {
713714
if (ctx.clientToProxyRequest.headers['proxy-connection']) {
714715
ctx.serverToProxyResponse.headers['proxy-connection'] = 'keep-alive';
716+
ctx.serverToProxyResponse.headers['connection'] = 'keep-alive';
715717
}
716718
} else {
717719
ctx.serverToProxyResponse.headers['connection'] = 'close';

0 commit comments

Comments
 (0)