Skip to content

Commit d597204

Browse files
Pedro Teixeiradaviddias
Pedro Teixeira
authored andcommitted
feat: set and hook up libp2p-connection-manager (#184)
1 parent 28ffa0c commit d597204

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@
3838
"homepage": "https://github.com/libp2p/js-libp2p",
3939
"dependencies": {
4040
"async": "^2.6.0",
41+
"libp2p-connection-manager": "~0.0.2",
4142
"libp2p-floodsub": "^0.15.0",
4243
"libp2p-ping": "~0.8.0",
4344
"libp2p-switch": "~0.40.4",
45+
"libp2p-websockets": "^0.12.0",
4446
"mafmt": "^6.0.0",
4547
"multiaddr": "^5.0.0",
4648
"peer-book": "~0.8.0",
4749
"peer-id": "~0.10.7",
48-
"libp2p-websockets": "^0.12.0",
4950
"peer-info": "~0.14.1"
5051
},
5152
"devDependencies": {
@@ -62,14 +63,14 @@
6263
"libp2p-secio": "~0.10.0",
6364
"libp2p-spdy": "~0.12.1",
6465
"libp2p-tcp": "~0.12.0",
66+
"libp2p-webrtc-star": "~0.15.0",
6567
"libp2p-websocket-star": "~0.8.0",
6668
"libp2p-websocket-star-rendezvous": "~0.2.3",
6769
"lodash.times": "^4.3.2",
6870
"pull-goodbye": "0.0.2",
6971
"pull-serializer": "~0.3.2",
7072
"pull-stream": "^3.6.8",
7173
"sinon": "^5.0.7",
72-
"libp2p-webrtc-star": "~0.15.0",
7374
"wrtc": "0.1.1"
7475
},
7576
"contributors": [

src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const PeerBook = require('peer-book')
1111
const Switch = require('libp2p-switch')
1212
const Ping = require('libp2p-ping')
1313
const WebSockets = require('libp2p-websockets')
14+
const ConnectionManager = require('libp2p-connection-manager')
1415

1516
const peerRouting = require('./peer-routing')
1617
const contentRouting = require('./content-routing')
@@ -37,6 +38,7 @@ class Node extends EventEmitter {
3738

3839
this.switch = new Switch(this.peerInfo, this.peerBook, _options.switch)
3940
this.stats = this.switch.stats
41+
this.connectionManager = new ConnectionManager(this, _options.connectionManager)
4042

4143
// Attach stream multiplexers
4244
if (this.modules.connection && this.modules.connection.muxer) {

0 commit comments

Comments
 (0)