2
0
miroir de https://git.coolaj86.com/coolaj86/telebit-relay.js.git synchronisé 2025-07-06 17:26:32 +00:00

close on error

Cette révision appartient à :
AJ ONeal 2016-10-12 19:11:11 -04:00
Parent 6185b79263
révision 09a98f6b3a

Voir le fichier

@ -189,7 +189,15 @@ module.exports.create = function (opts) {
// var chunk = socket.read();
console.log('[bstream] data from browser to tunneler', pchunk.byteLength);
//console.log(JSON.stringify(pchunk.toString()));
ws.send(pchunk, { binary: true });
try {
ws.send(pchunk, { binary: true });
} catch(e) {
try {
bstream.browser.end();
} catch(e) {
// ignore
}
}
});
bstream.wrapped.on('error', function (err) {
console.error('[error] bstream.wrapped.error');