From 5046c360baadaab38bc445a60175b40b7615c872 Mon Sep 17 00:00:00 2001 From: Roman Shtylman Date: Thu, 11 Dec 2014 19:34:08 -0800 Subject: [PATCH] don't log econnreset or timeout errors --- proxy.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/proxy.js b/proxy.js index 6c9cdff..0dac166 100644 --- a/proxy.js +++ b/proxy.js @@ -33,6 +33,14 @@ var Proxy = function(opt, cb) { }); }); + client_server.on('error', function(err) { + if (err.code == 'ECONNRESET' || err.code == 'ETIMEDOUT') { + return; + } + + log.error(err); + }); + // track initial user connection setup var conn_timeout; @@ -118,10 +126,6 @@ var Proxy = function(opt, cb) { self.next_socket(wait_cb); } }); - - client_server.on('error', function(err) { - log.error(err); - }); }; Proxy.prototype.__proto__ = EventEmitter.prototype;