From a3c65de9a4a92c31e7573c78fb504b8ed4982d34 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Thu, 30 Jul 2015 02:41:49 +0200 Subject: [PATCH] Display more information in proxy.js --- examples/proxy/proxy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/proxy/proxy.js b/examples/proxy/proxy.js index d2b8c72..d9f6cf1 100644 --- a/examples/proxy/proxy.js +++ b/examples/proxy/proxy.js @@ -159,6 +159,8 @@ srv.on('login', function(client) { console.log("client->server: Error in packetId " + state + ".0x" + packetId.value.toString(16)); console.log(buffer.toString('hex')); console.log(packetBuff.toString('hex')); + console.log(buffer.length); + console.log(packetBuff.length); } }); targetClient.on('end', function() { @@ -167,9 +169,10 @@ srv.on('login', function(client) { if(!endedClient) client.end("End"); }); - targetClient.on('error', function() { + targetClient.on('error', function(err) { endedTargetClient = true; - console.log('Connection error by server', '(' + addr + ')'); + console.log('Connection error by server', '(' + addr + ') ',err); + console.log(err.stack); if(!endedClient) client.end("Error"); });