File tree Expand file tree Collapse file tree 14 files changed +302
-242
lines changed Expand file tree Collapse file tree 14 files changed +302
-242
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const pull = require('pull-stream')
8
8
const PeerBook = require ( 'peer-book' )
9
9
10
10
const Switch = require ( './src' )
11
+ const mplex = require ( 'pull-mplex' )
11
12
const spdy = require ( 'libp2p-spdy' )
12
13
const fs = require ( 'fs' )
13
14
const path = require ( 'path' )
@@ -54,6 +55,7 @@ function pre (done) {
54
55
switchB = new Switch ( peerB , new PeerBook ( ) )
55
56
56
57
switchB . transport . add ( 'ws' , new WebSockets ( ) )
58
+ switchB . connection . addStreamMuxer ( mplex )
57
59
switchB . connection . addStreamMuxer ( spdy )
58
60
switchB . connection . reuse ( )
59
61
switchB . handle ( '/echo/1.0.0' , echo )
Original file line number Diff line number Diff line change
1
+ language : node_js
2
+ cache : npm
3
+ stages :
4
+ - check
5
+ - test
6
+ - cov
7
+
8
+ node_js :
9
+ - ' 10'
10
+
11
+ os :
12
+ - linux
13
+ - osx
14
+ - windows
15
+
16
+ script : npx nyc -s npm run test:node -- --bail
17
+ after_success : npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
18
+
19
+ jobs :
20
+ include :
21
+ - stage : check
22
+ script :
23
+ - npx aegir commitlint --travis
24
+ - npx aegir dep-check
25
+ - npm run lint
26
+
27
+ - stage : test
28
+ name : chrome
29
+ addons :
30
+ chrome : stable
31
+ script : npx aegir test -t browser
32
+
33
+ - stage : test
34
+ name : firefox
35
+ addons :
36
+ firefox : latest
37
+ script : npx aegir test -t browser -- --browsers FirefoxHeadless
38
+
39
+ notifications :
40
+ email : false
41
+
Original file line number Diff line number Diff line change @@ -4,9 +4,8 @@ libp2p-switch JavaScript implementation
4
4
[ ![ ] ( https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square )] ( http://ipn.io )
5
5
[ ![ ] ( https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square )] ( http://ipfs.io/ )
6
6
[ ![ ] ( https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square )] ( http://webchat.freenode.net/?channels=%23ipfs )
7
- [ ![ Build Status] ( https://img.shields.io/travis/libp2p/js-libp2p-switch/master.svg?style=flat-square )] ( https://travis-ci.org/libp2p/js-libp2p-switch )
8
- [ ![ Circle CI] ( https://circleci.com/gh/libp2p/js-libp2p-switch.svg?style=svg )] ( https://circleci.com/gh/libp2p/js-libp2p-switch )
9
- [ ![ Coverage Status] ( https://coveralls.io/repos/github/libp2p/js-libp2p-switch/badge.svg?branch=master )] ( https://coveralls.io/github/libp2p/js-libp2p-switch?branch=master )
7
+ [ ![ Travis CI] ( https://flat.badgen.net/travis/libp2p/js-libp2p-switch )] ( https://travis-ci.com/libp2p/js-libp2p-switch )
8
+ [ ![ codecov] ( https://codecov.io/gh/libp2p/js-libp2p-switch/branch/master/graph/badge.svg )] ( https://codecov.io/gh/libp2p/js-libp2p-switch )
10
9
[ ![ Dependency Status] ( https://david-dm.org/libp2p/js-libp2p-switch.svg?style=flat-square )] ( https://david-dm.org/libp2p/js-libp2p-switch )
11
10
[ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square )] ( https://github.com/feross/standard )
12
11
![ ] ( https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 40
40
"npm" : " >=3.0.0"
41
41
},
42
42
"devDependencies" : {
43
- "aegir" : " ^18.0.3 " ,
43
+ "aegir" : " ^18.1.0 " ,
44
44
"chai" : " ^4.2.0" ,
45
45
"chai-checkmark" : " ^1.0.1" ,
46
46
"dirty-chai" : " ^2.0.1" ,
47
47
"libp2p-mplex" : " ~0.8.4" ,
48
48
"libp2p-pnet" : " ~0.1.0" ,
49
- "libp2p-secio" : " ~0.11.0 " ,
49
+ "libp2p-secio" : " ~0.11.1 " ,
50
50
"libp2p-spdy" : " ~0.13.1" ,
51
51
"libp2p-tcp" : " ~0.13.0" ,
52
52
"libp2p-webrtc-star" : " ~0.15.8" ,
53
- "libp2p-websockets" : " ~0.12.1 " ,
53
+ "libp2p-websockets" : " ~0.12.2 " ,
54
54
"peer-book" : " ~0.9.1" ,
55
55
"portfinder" : " ^1.0.20" ,
56
- "sinon" : " ^7.2.0" ,
56
+ "pull-length-prefixed" : " ^1.3.1" ,
57
+ "pull-mplex" : " ~0.1.0" ,
58
+ "pull-pair" : " ^1.1.0" ,
59
+ "sinon" : " ^7.2.3" ,
57
60
"webrtcsupport" : " ^2.2.0"
58
61
},
59
62
"dependencies" : {
60
- "async" : " ^2.6.1 " ,
61
- "bignumber.js" : " ^8.0.1 " ,
63
+ "async" : " ^2.6.2 " ,
64
+ "bignumber.js" : " ^8.0.2 " ,
62
65
"class-is" : " ^1.1.0" ,
63
66
"debug" : " ^4.1.1" ,
64
67
"err-code" : " ^1.1.2" ,
68
71
"libp2p-circuit" : " ~0.3.4" ,
69
72
"libp2p-identify" : " ~0.7.5" ,
70
73
"moving-average" : " ^1.0.0" ,
71
- "multiaddr" : " ^6.0.3 " ,
74
+ "multiaddr" : " ^6.0.4 " ,
72
75
"multistream-select" : " ~0.14.4" ,
73
76
"once" : " ^1.4.0" ,
74
77
"peer-id" : " ~0.12.2" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class BaseConnection extends EventEmitter {
21
21
* @returns {void }
22
22
*/
23
23
close ( err ) {
24
+ if ( this . _state . _state === 'DISCONNECTING' ) return
24
25
this . log ( `closing connection to ${ this . theirB58Id } ` )
25
26
if ( err && this . _events . error ) {
26
27
this . emit ( 'error' , err )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const parallel = require('async/parallel')
12
12
const series = require ( 'async/series' )
13
13
const TCP = require ( 'libp2p-tcp' )
14
14
const WS = require ( 'libp2p-websockets' )
15
- const multiplex = require ( 'libp2p -mplex' )
15
+ const multiplex = require ( 'pull -mplex' )
16
16
const PeerBook = require ( 'peer-book' )
17
17
const getPorts = require ( 'portfinder' ) . getPorts
18
18
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const WS = require('libp2p-websockets')
11
11
const parallel = require ( 'async/parallel' )
12
12
const secio = require ( 'libp2p-secio' )
13
13
const pull = require ( 'pull-stream' )
14
- const multiplex = require ( 'libp2p -mplex' )
14
+ const multiplex = require ( 'pull -mplex' )
15
15
const spdy = require ( 'libp2p-spdy' )
16
16
const Connection = require ( 'interface-connection' ) . Connection
17
17
const Protector = require ( 'libp2p-pnet' )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const parallel = require('async/parallel')
11
11
const WS = require ( 'libp2p-websockets' )
12
12
const TCP = require ( 'libp2p-tcp' )
13
13
const secio = require ( 'libp2p-secio' )
14
- const multiplex = require ( 'libp2p -mplex' )
14
+ const multiplex = require ( 'pull -mplex' )
15
15
const pull = require ( 'pull-stream' )
16
16
17
17
const utils = require ( './utils' )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const expect = chai.expect
7
7
chai . use ( dirtyChai )
8
8
const parallel = require ( 'async/parallel' )
9
9
const TCP = require ( 'libp2p-tcp' )
10
- const multiplex = require ( 'libp2p -mplex' )
10
+ const multiplex = require ( 'pull -mplex' )
11
11
const pull = require ( 'pull-stream' )
12
12
const PeerBook = require ( 'peer-book' )
13
13
const secio = require ( 'libp2p-secio' )
You can’t perform that action at this time.
0 commit comments