connection handling

Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
dzdidi
2024-02-01 19:09:20 +00:00
parent 11f457b60c
commit 082f72fc4d

View File

@@ -17,6 +17,8 @@ module.exports = class RPC {
if (this.connections[peerInfo.publicKey]) return this.connections[peerInfo.publicKey] if (this.connections[peerInfo.publicKey]) return this.connections[peerInfo.publicKey]
const rpc = new ProtomuxRPC(socket) 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 // XXX: handshaking can be used for access and permission management
// for example check of peerInfo.publicKey is in a list of allowed keys // 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 // which can in turn be stored in a .git-daemon-export-ok file