display error in proxy

This commit is contained in:
Romain Beaumont 2016-02-15 20:50:42 +01:00
parent 88c20cf795
commit 86397e7d06

View File

@ -85,9 +85,10 @@ srv.on('login', function(client) {
if(!endedTargetClient) if(!endedTargetClient)
targetClient.end("End"); targetClient.end("End");
}); });
client.on('error', function() { client.on('error', function(err) {
endedClient = true; endedClient = true;
console.log('Connection error by client', '(' + addr + ')'); console.log('Connection error by client', '(' + addr + ')');
console.log(err.stack);
if(!endedTargetClient) if(!endedTargetClient)
targetClient.end("Error"); targetClient.end("Error");
}); });