diff --git a/lib/server.js b/lib/server.js index 0d0c2eb..e2bac07 100644 --- a/lib/server.js +++ b/lib/server.js @@ -52,11 +52,7 @@ module.exports = function(options) { let client = tcpClient(mx, options.tcpPort, options.tcpHostname); client.on('connection', data => obj.emit('tcp-connection', data, stream)); client.on('close', () => obj.emit('tcp-close')); - client.on('error', err => { - mx.destroy(); - stream.destroy(); - obj.emit('error', err); - }); + client.on('error', err => obj.emit('error', err)); } stream.on('end', () => { mx.destroy();