From a9e562a191d0ee45eaaa29cb53ae2ca526fd3e76 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 30 Sep 2016 03:12:54 -0400 Subject: [PATCH] no debug with buf.toString() --- wsclient.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/wsclient.js b/wsclient.js index 72a55f4..fdf0d42 100644 --- a/wsclient.js +++ b/wsclient.js @@ -77,17 +77,6 @@ return; var str; var m; - if (opts.data.byteLength < 20) { - if ('|__ERROR__|' === opts.data.toString('ascii')) { - handlers.onerror(opts); - return; - } - else if ('|__END__|' === opts.data.toString('ascii')) { - handlers.onend(opts); - return; - } - } - function endWithError() { try { wstunneler.send(pack(opts, null, 'error'), { binary: true }); @@ -115,8 +104,8 @@ return; } if (!servername) { - console.warn("|__ERROR__| no servername found for '" + cid + "'"); - console.warn(opts.data.toString()); + console.warn("|__ERROR__| no servername found for '" + cid + "'", opts.data.byteLength); + //console.warn(opts.data.toString()); wstunneler.send(pack(opts, null, 'error'), { binary: true }); return; } @@ -129,7 +118,7 @@ return; }); lclient.on('data', function (chunk) { console.log("[<=] local '" + opts.service + "' sent to '" + cid + "' <= ", chunk.byteLength, "bytes"); - console.log(JSON.stringify(chunk.toString())); + //console.log(JSON.stringify(chunk.toString())); wstunneler.send(pack(opts, chunk), { binary: true }); }); lclient.on('error', function (err) {