mirror of
https://git.coolaj86.com/coolaj86/telebit-relay.js.git
synced 2025-04-21 19:10:37 +00:00
close on error
This commit is contained in:
parent
6185b79263
commit
09a98f6b3a
10
wstunneld.js
10
wstunneld.js
@ -189,7 +189,15 @@ module.exports.create = function (opts) {
|
|||||||
// var chunk = socket.read();
|
// var chunk = socket.read();
|
||||||
console.log('[bstream] data from browser to tunneler', pchunk.byteLength);
|
console.log('[bstream] data from browser to tunneler', pchunk.byteLength);
|
||||||
//console.log(JSON.stringify(pchunk.toString()));
|
//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) {
|
bstream.wrapped.on('error', function (err) {
|
||||||
console.error('[error] bstream.wrapped.error');
|
console.error('[error] bstream.wrapped.error');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user