mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-18 19:51:23 +00:00
fix: connection emits (#352)
* fix: add connection tracking events * chore: update dependencies
This commit is contained in:
@ -85,6 +85,14 @@ class Node extends EventEmitter {
|
||||
})
|
||||
}
|
||||
|
||||
// Events for anytime connections are created/removed
|
||||
this._switch.on('connection:start', (peerInfo) => {
|
||||
this.emit('connection:start', peerInfo)
|
||||
})
|
||||
this._switch.on('connection:end', (peerInfo) => {
|
||||
this.emit('connection:end', peerInfo)
|
||||
})
|
||||
|
||||
// Attach crypto channels
|
||||
if (this._modules.connEncryption) {
|
||||
let cryptos = this._modules.connEncryption
|
||||
|
Reference in New Issue
Block a user