Skip to content

Commit 10c0f11

Browse files
committed
[fix] remove duplicate
1 parent 83367e7 commit 10c0f11

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

lib/http-proxy/passes/ws-incoming.js

-18
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,6 @@ var passes = exports;
4141
}
4242
},
4343

44-
/**
45-
* Set the proper configuration for sockets,
46-
* set no delay and set keep alive, also set
47-
* the timeout to 0.
48-
*
49-
* @param {ClientRequest} Req Request object
50-
* @param {Socket} Websocket
51-
*
52-
* @api private
53-
*/
54-
55-
function setupSocket(req, socket) {
56-
socket.setTimeout(0);
57-
socket.setNoDelay(true);
58-
59-
socket.setKeepAlive(true, 0);
60-
},
61-
6244
/**
6345
* Sets `x-forwarded-*` headers if specified in config.
6446
*

test/lib-http-proxy-passes-ws-incoming-test.js

-29
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,6 @@ describe('lib/http-proxy/passes/ws-incoming.js', function () {
7676
})
7777
});
7878

79-
describe('#setupSocket', function () {
80-
it('Set the correct config to the socket', function () {
81-
var stubSocket = {
82-
setTimeout: function (num) {
83-
// Simulate Socket.setTimeout()
84-
socketConfig.timeout = num;
85-
},
86-
setNoDelay: function (bol) {
87-
// Simulate Socket.setNoDelay()
88-
socketConfig.nodelay = bol;
89-
},
90-
setKeepAlive: function (bol) {
91-
// Simulate Socket.setKeepAlive()
92-
socketConfig.keepalive = bol;
93-
}
94-
},
95-
socketConfig = {
96-
timeout: null,
97-
nodelay: false,
98-
keepalive: false
99-
},
100-
returnValue = httpProxy.setupSocket({}, stubSocket);
101-
expect(returnValue).to.be(undefined);
102-
expect(socketConfig.timeout).to.eql(0);
103-
expect(socketConfig.nodelay).to.eql(true);
104-
expect(socketConfig.keepalive).to.eql(true);
105-
});
106-
});
107-
10879
describe('#XHeaders', function () {
10980
it('return if no forward request', function () {
11081
var returnValue = httpProxy.XHeaders({}, {}, {});

0 commit comments

Comments
 (0)