From b983c64c9aa8aefd84b515b7d407838e7ed40130 Mon Sep 17 00:00:00 2001 From: linqFR <18004866+linqFR@users.noreply.github.com> Date: Mon, 26 Apr 2021 09:32:31 +0200 Subject: [PATCH] fix: websocket not handling 'error' event (#8) --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 7391bc7..dc234c0 100644 --- a/index.js +++ b/index.js @@ -58,6 +58,7 @@ const createServer = (aedes, options = {}) => { } } const ws = new WebSocket.Server({ server }) + ws.on('error', error => server.emit('error', error)) ws.on('connection', (conn, req) => { const stream = WebSocket.createWebSocketStream(conn) // the _socket object is needed in bindConnection to retrieve info from the stream