This repository was archived by the owner on Apr 29, 2020. It is now read-only.
File tree 2 files changed +13
-9
lines changed 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 32
32
},
33
33
"homepage" : " https://github.com/ipfs/js-libp2p-ipfs#readme" ,
34
34
"devDependencies" : {
35
- "aegir" : " ^6 .0.1 " ,
35
+ "aegir" : " ^8 .0.0 " ,
36
36
"chai" : " ^3.5.0" ,
37
37
"pre-commit" : " ^1.1.3" ,
38
38
"pull-stream" : " ^3.4.5" ,
39
39
"run-parallel" : " ^1.1.6"
40
40
},
41
41
"dependencies" : {
42
- "libp2p-spdy" : " ^0.8.1" ,
43
- "libp2p-swarm" : " ^0.22.2" ,
44
- "libp2p-tcp" : " ^0.7.4" ,
45
- "libp2p-websockets" : " ^0.7.1" ,
46
- "mafmt" : " ^2.1.1" ,
42
+ "libp2p-secio" : " ^0.4.2" ,
43
+ "libp2p-spdy" : " ^0.9.0" ,
44
+ "libp2p-swarm" : " ^0.22.3" ,
45
+ "libp2p-tcp" : " ^0.8.1" ,
46
+ "libp2p-websockets" : " ^0.8.1" ,
47
+ "mafmt" : " ^2.1.2" ,
47
48
"multiaddr" : " ^2.0.2" ,
48
49
"peer-book" : " ^0.3.0" ,
49
50
"peer-id" : " ^0.7.0" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const Swarm = require ( 'libp2p-swarm' )
4
- const PeerId = require ( 'peer-id' )
5
- const PeerInfo = require ( 'peer-info' )
6
- const PeerBook = require ( 'peer-book' )
7
4
const TCP = require ( 'libp2p-tcp' )
8
5
// const UTP = require('libp2p-utp')
9
6
const WS = require ( 'libp2p-websockets' )
10
7
const spdy = require ( 'libp2p-spdy' )
8
+ const secio = require ( 'libp2p-secio' )
9
+ const PeerId = require ( 'peer-id' )
10
+ const PeerInfo = require ( 'peer-info' )
11
+ const PeerBook = require ( 'peer-book' )
11
12
const multiaddr = require ( 'multiaddr' )
12
13
const mafmt = require ( 'mafmt' )
13
14
const EE = require ( 'events' ) . EventEmitter
@@ -39,6 +40,8 @@ exports.Node = function Node (pInfo, pBook) {
39
40
this . swarm . connection . addStreamMuxer ( spdy )
40
41
this . swarm . connection . reuse ( )
41
42
43
+ this . swarm . connection . crypto ( secio . tag , secio . encrypt )
44
+
42
45
this . swarm . on ( 'peer-mux-established' , ( peerInfo ) => {
43
46
this . peerBook . put ( peerInfo )
44
47
} )
You can’t perform that action at this time.
0 commit comments