diff --git a/bin/proxy/websocket.js b/bin/proxy/websocket.js index 80d8cdd6..acaaae1c 100644 --- a/bin/proxy/websocket.js +++ b/bin/proxy/websocket.js @@ -92,6 +92,11 @@ function bind_listen(server) { } d.on('error', function(err) { + if (err && err.message && errorIgnore[err.message] === 'ignore') { + logger.warn(err && err.stack); + return; + } + if (err && err.stack && err.message) { const key = err.message; const content = `
错误堆栈
${err.stack}
`;
@@ -263,3 +268,11 @@ exports.start_listen = function() {
bind_listen(wss);
}
};
+
+const errorIgnore = {
+ 'socket hang up': 'ignore',
+ 'Cannot read property \'asyncReset\' of null': 'ignore',
+ 'Cannot read property \'resume\' of null': 'ignore',
+ 'write ECONNRESET': 'ignore',
+ 'This socket is closed': 'ignore'
+};