From 082f72fc4de47ff72547bb994c56fd4976de0caa Mon Sep 17 00:00:00 2001 From: dzdidi Date: Thu, 1 Feb 2024 19:09:20 +0000 Subject: [PATCH] connection handling Signed-off-by: dzdidi --- src/rpc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc.js b/src/rpc.js index 35d83be..ca349ab 100755 --- a/src/rpc.js +++ b/src/rpc.js @@ -17,6 +17,8 @@ module.exports = class RPC { if (this.connections[peerInfo.publicKey]) return this.connections[peerInfo.publicKey] const rpc = new ProtomuxRPC(socket) + rpc.on('error', err => console.error('rpc error', err)) + rpc.on('close', () => delete this.connections[peerInfo.publicKey]) // XXX: handshaking can be used for access and permission management // for example check of peerInfo.publicKey is in a list of allowed keys // which can in turn be stored in a .git-daemon-export-ok file