diff --git a/package.json b/package.json index b0740b6aaf..6dfcbb22d4 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "homepage": "https://github.com/libp2p/js-libp2p", "dependencies": { "async": "^2.6.0", + "libp2p-connection-manager": "^0.1.0", "libp2p-floodsub": "^0.15.0", "libp2p-ping": "~0.7.0", "libp2p-switch": "~0.39.0", diff --git a/src/index.js b/src/index.js index bdddea1d77..bbc2342b81 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,7 @@ const PeerBook = require('peer-book') const Switch = require('libp2p-switch') const Ping = require('libp2p-ping') const WebSockets = require('libp2p-websockets') +const ConnectionManager = require('libp2p-connection-manager') const peerRouting = require('./peer-routing') const contentRouting = require('./content-routing') @@ -37,6 +38,7 @@ class Node extends EventEmitter { this.switch = new Switch(this.peerInfo, this.peerBook, _options.switch) this.stats = this.switch.stats + this.connectionManager = new ConnectionManager(this, _options.connectionManager) // Attach stream multiplexers if (this.modules.connection && this.modules.connection.muxer) {