Skip to content

Commit 0f08a19

Browse files
committed
chore(websocket): dead code removal
1 parent c6608dd commit 0f08a19

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

bin/proxy/http.proxy.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ function requestHandler(req, res) {
200200
// 发者模式清除缓存
201201
cleanCache();
202202
}
203-
if (req.headers.connection === 'upgrade' && req.headers.upgrade === 'websocket') {
204-
// websocket
205-
return;
206-
}
207203
res.flush = res.flush || empty;
208204
parseGet(req); // 解析get参数
209205
doRoute(req, res); // HTTP路由

bin/proxy/websocket.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function wsFiller(ws, req) {
5050
ws.logKey = req.headers['sec-websocket-key'] || Math.random();
5151
}
5252

53-
function emitReportLig(ws, type) {
53+
function emitReportLog(ws, type) {
5454
ws.upgradeReq.emit(type);
5555
ws.messageTriggerCount = 0;
5656
}
@@ -61,15 +61,15 @@ function reportWebSocketLog(ws, isEnd) {
6161
// 每次上报log时,先看下Log多不多,不多的话,延迟上报下
6262
clearTimeout(ws.logReportTimer);
6363
if (isEnd) {
64-
emitReportLig('reportLog');
64+
emitReportLog('reportLog');
6565
} else if (logLength > 30) {
6666
// 立即上报
67-
emitReportLig('reportLogStream');
67+
emitReportLog('reportLogStream');
6868
} else if (ws.messageTriggerCount > 9) {
69-
emitReportLig('reportLogStream');
69+
emitReportLog('reportLogStream');
7070
} else {
7171
ws.logReportTimer = setTimeout(function() {
72-
emitReportLig('reportLogStream');
72+
emitReportLog('reportLogStream');
7373
}, 5000);
7474
}
7575
}

0 commit comments

Comments
 (0)