mirror of
https://github.com/SnapDrop/snapdrop.git
synced 2024-11-22 06:34:55 +03:00
Add error handler to ws connection
This commit is contained in:
parent
070f6a954f
commit
2e0619fbba
@ -30,6 +30,7 @@ class SnapdropServer {
|
||||
_onConnection(peer) {
|
||||
this._joinRoom(peer);
|
||||
peer.socket.on('message', message => this._onMessage(peer, message));
|
||||
peer.socket.on('error', console.error);
|
||||
this._keepAlive(peer);
|
||||
|
||||
// send displayName
|
||||
@ -288,4 +289,4 @@ Object.defineProperty(String.prototype, 'hashCode', {
|
||||
}
|
||||
});
|
||||
|
||||
const server = new SnapdropServer(process.env.PORT || 3000);
|
||||
const server = new SnapdropServer(process.env.PORT || 3000);
|
||||
|
Loading…
Reference in New Issue
Block a user