From 442283f42c2e5205b9e2f8fd81b3da020bc730e2 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 30 Sep 2016 02:15:38 -0400 Subject: [PATCH] null buffers --- wsclient.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wsclient.js b/wsclient.js index 0ae52d0..d0d1c7e 100644 --- a/wsclient.js +++ b/wsclient.js @@ -89,7 +89,7 @@ return; } function endWithError() { - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); + wstunneler.send(pack(opts, null, 'error'), { binary: true }); } if (localclients[cid]) { @@ -113,7 +113,7 @@ return; if (!servername) { console.warn("|__ERROR__| no servername found for '" + cid + "'"); console.warn(opts.data.toString()); - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); + wstunneler.send(pack(opts, null, 'error'), { binary: true }); return; } @@ -132,12 +132,12 @@ return; console.error("[error] local '" + opts.service + "' '" + cid + "'"); console.error(err); delete localclients[cid]; - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); + wstunneler.send(pack(opts, null, 'error'), { binary: true }); }); lclient.on('end', function () { console.log("[end] local '" + opts.service + "' '" + cid + "'"); delete localclients[cid]; - wstunneler.send(pack(opts, Buffer.from('|__END__|'), 'end'), { binary: true }); + wstunneler.send(pack(opts, null, 'end'), { binary: true }); }); } , onend: function (opts) {