From 1bdfad6691fc798052ac3a253ef2f32daaafd5a7 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 29 Sep 2016 23:44:26 -0400 Subject: [PATCH] add type --- wsclient.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wsclient.js b/wsclient.js index 4d7bee4..803beac 100644 --- a/wsclient.js +++ b/wsclient.js @@ -85,7 +85,7 @@ wstunneler.on('open', function () { } function endWithError() { - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|')), { binary: true }); + wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); } if (localclients[cid]) { @@ -109,7 +109,7 @@ wstunneler.on('open', function () { if (!servername) { console.warn("|__ERROR__| no servername found for '" + cid + "'"); console.warn(opts.data.toString()); - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|')), { binary: true }); + wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); return; } @@ -126,12 +126,12 @@ wstunneler.on('open', function () { console.error("[error] local '" + opts.service + "' '" + cid + "'"); console.error(err); delete localclients[cid]; - wstunneler.send(pack(opts, Buffer.from('|__ERROR__|')), { binary: true }); + wstunneler.send(pack(opts, Buffer.from('|__ERROR__|'), 'error'), { binary: true }); }); lclient.on('end', function () { console.log("[end] local '" + opts.service + "' '" + cid + "'"); delete localclients[cid]; - wstunneler.send(pack(opts, Buffer.from('|__END__|')), { binary: true }); + wstunneler.send(pack(opts, Buffer.from('|__END__|'), 'end'), { binary: true }); }); console.log("[=>] first packet from tunneler to '" + cid + "' as '" + opts.service + "'", opts.data.byteLength);