[fix] remove duplicate

This commit is contained in:
yawnt 2013-11-19 20:05:46 +01:00
parent 83367e7e91
commit 10c0f11b68
2 changed files with 0 additions and 47 deletions

View File

@ -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. * Sets `x-forwarded-*` headers if specified in config.
* *

View File

@ -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 () { describe('#XHeaders', function () {
it('return if no forward request', function () { it('return if no forward request', function () {
var returnValue = httpProxy.XHeaders({}, {}, {}); var returnValue = httpProxy.XHeaders({}, {}, {});