diff --git a/lib/http-proxy/passes/ws-incoming.js b/lib/http-proxy/passes/ws-incoming.js index ab99aa2..99a6f87 100644 --- a/lib/http-proxy/passes/ws-incoming.js +++ b/lib/http-proxy/passes/ws-incoming.js @@ -41,24 +41,6 @@ var passes = exports; } }, - /** - * Set the proper configuration for sockets, - * set no delay and set keep alive, also set - * the timeout to 0. - * - * @param {ClientRequest} Req Request object - * @param {Socket} Websocket - * - * @api private - */ - - function setupSocket(req, socket) { - socket.setTimeout(0); - socket.setNoDelay(true); - - socket.setKeepAlive(true, 0); - }, - /** * Sets `x-forwarded-*` headers if specified in config. * diff --git a/test/lib-http-proxy-passes-ws-incoming-test.js b/test/lib-http-proxy-passes-ws-incoming-test.js index 87dfcef..2f696c7 100644 --- a/test/lib-http-proxy-passes-ws-incoming-test.js +++ b/test/lib-http-proxy-passes-ws-incoming-test.js @@ -76,35 +76,6 @@ describe('lib/http-proxy/passes/ws-incoming.js', function () { }) }); - describe('#setupSocket', function () { - it('Set the correct config to the socket', function () { - var stubSocket = { - setTimeout: function (num) { - // Simulate Socket.setTimeout() - socketConfig.timeout = num; - }, - setNoDelay: function (bol) { - // Simulate Socket.setNoDelay() - socketConfig.nodelay = bol; - }, - setKeepAlive: function (bol) { - // Simulate Socket.setKeepAlive() - socketConfig.keepalive = bol; - } - }, - socketConfig = { - timeout: null, - nodelay: false, - keepalive: false - }, - returnValue = httpProxy.setupSocket({}, stubSocket); - expect(returnValue).to.be(undefined); - expect(socketConfig.timeout).to.eql(0); - expect(socketConfig.nodelay).to.eql(true); - expect(socketConfig.keepalive).to.eql(true); - }); - }); - describe('#XHeaders', function () { it('return if no forward request', function () { var returnValue = httpProxy.XHeaders({}, {}, {});