From 812868ddfc720b6c4fd26603c2fe4d5ae68f2492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Fri, 10 Aug 2012 21:39:39 +0200 Subject: [PATCH] [minor] Remove `setEncoding` on incoming socket This isn't needed as we don't do any string operations and `setEncoding` results in a higher memory usage and is slower. --- lib/node-http-proxy/http-proxy.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 4a84b58..ebc29a5 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -452,9 +452,6 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) socket.pair.cleartext.socket.setKeepAlive(true, 0); } } - else { - socket.setEncoding('utf8'); - } } //