Skip to content

Commit

Permalink
Added global ws error handler (#6475)
Browse files Browse the repository at this point in the history
  • Loading branch information
HuFlungDu authored Oct 25, 2024
1 parent 141bec5 commit 36f1b4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6334,6 +6334,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF

// Handle all incoming web sockets, see if some need to be handled as web relays
obj.app.ws('/*', function (ws, req, next) {
// Global error catcher
ws.on('error', function (err) { parent.debug('web', 'GENERAL WSERR: ' + err); console.log(err); });
if ((obj.webRelayRouter != null) && (obj.args.relaydns.indexOf(req.hostname) >= 0)) { handleWebRelayWebSocket(ws, req); return; }
return next();
});
Expand Down

0 comments on commit 36f1b4d

Please sign in to comment.