diff --git a/package.json b/package.json index b65379d7fb..d47dafe873 100644 --- a/package.json +++ b/package.json @@ -38,14 +38,15 @@ "homepage": "https://github.com/libp2p/js-libp2p", "dependencies": { "async": "^2.6.0", + "libp2p-connection-manager": "~0.0.2", "libp2p-floodsub": "^0.15.0", "libp2p-ping": "~0.8.0", "libp2p-switch": "~0.40.4", + "libp2p-websockets": "^0.12.0", "mafmt": "^6.0.0", "multiaddr": "^5.0.0", "peer-book": "~0.8.0", "peer-id": "~0.10.7", - "libp2p-websockets": "^0.12.0", "peer-info": "~0.14.1" }, "devDependencies": { @@ -62,6 +63,7 @@ "libp2p-secio": "~0.10.0", "libp2p-spdy": "~0.12.1", "libp2p-tcp": "~0.12.0", + "libp2p-webrtc-star": "~0.15.0", "libp2p-websocket-star": "~0.8.0", "libp2p-websocket-star-rendezvous": "~0.2.3", "lodash.times": "^4.3.2", @@ -69,7 +71,6 @@ "pull-serializer": "~0.3.2", "pull-stream": "^3.6.8", "sinon": "^5.0.7", - "libp2p-webrtc-star": "~0.15.0", "wrtc": "0.1.1" }, "contributors": [ 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) {