Skip to content

Commit

Permalink
[fix] remove duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Nov 19, 2013
1 parent 83367e7 commit 10c0f11
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
18 changes: 0 additions & 18 deletions lib/http-proxy/passes/ws-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
29 changes: 0 additions & 29 deletions test/lib-http-proxy-passes-ws-incoming-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({}, {}, {});
Expand Down

0 comments on commit 10c0f11

Please sign in to comment.