From 7e8f90a89fe6ad38c795176eb30987d45eba41a0 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 12 Oct 2016 13:11:21 -0600 Subject: [PATCH] working --- wsclient.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wsclient.js b/wsclient.js index faa9df2..439d630 100644 --- a/wsclient.js +++ b/wsclient.js @@ -77,12 +77,14 @@ function run(copts) { //localclients[cid].resume(); }); // 'data' + /* localclients[cid].on('data', function (chunk) { //console.log("[<=] local '" + opts.service + "' sent to '" + cid + "' <= ", chunk.byteLength, "bytes"); //console.log(JSON.stringify(chunk.toString())); wstunneler.send(Packer.pack(opts, chunk), { binary: true }); }); - /* + //*/ + ///* localclients[cid].on('readable', function (size) { var chunk; @@ -100,10 +102,12 @@ function run(copts) { chunk = localclients[cid].read(size); //console.log("[<=] local '" + opts.service + "' sent to '" + cid + "' <= ", chunk.byteLength, "bytes"); //console.log(JSON.stringify(chunk.toString())); - wstunneler.send(Packer.pack(opts, chunk), { binary: true }); + if (chunk) { + wstunneler.send(Packer.pack(opts, chunk), { binary: true }); + } } while (chunk); }); - */ + //*/ localclients[cid].on('error', function (err) { handlers._onLocalError(cid, opts, err); });