mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved some websocket error handling.
This commit is contained in:
parent
d7b60ccb07
commit
8b60090e33
10 changed files with 45 additions and 37 deletions
|
@ -191,13 +191,13 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain, user, cookie
|
|||
}
|
||||
});
|
||||
|
||||
// If error, do nothing.
|
||||
// If error, close both sides of the relay.
|
||||
ws.on('error', function (err) {
|
||||
console.log('Relay error from ' + obj.remoteaddr + ', ' + err.toString().split('\r')[0] + '.');
|
||||
closeBothSides();
|
||||
});
|
||||
|
||||
// If the mesh relay web socket is closed.
|
||||
// If the relay web socket is closed, close both sides.
|
||||
ws.on('close', function (req) {
|
||||
closeBothSides();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue