Skip to content

Commit

Permalink
fix: websocket not handling 'error' event (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
linqFR authored Apr 26, 2021
1 parent b7f3c44 commit b983c64
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b983c64

Please sign in to comment.