diff --git a/gulpfile.js b/gulpfile.js index e66aba5..ff0094f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,7 +15,7 @@ gulp.task('test:browser:before', (done) => { function createListenerA (cb) { const b58IdA = 'QmWg2L4Fucx1x4KXJTfKHGixBJvveubzcd7DdhB2Mqwfh1' const peerA = new Peer(Id.createFromB58String(b58IdA)) - const maA = multiaddr('/ip4/127.0.0.1/tcp/9100/websockets') + const maA = multiaddr('/ip4/127.0.0.1/tcp/9100/ws') peerA.multiaddr.add(maA) swarmA = new Swarm(peerA) @@ -25,7 +25,7 @@ gulp.task('test:browser:before', (done) => { function createListenerB (cb) { const b58IdB = 'QmRy1iU6BHmG5Hd8rnPhPL98cy1W1przUSTAMcGDq9yAAV' - const maB = multiaddr('/ip4/127.0.0.1/tcp/9200/websockets') + const maB = multiaddr('/ip4/127.0.0.1/tcp/9200/ws') const peerB = new Peer(Id.createFromB58String(b58IdB)) peerB.multiaddr.add(maB) swarmB = new Swarm(peerB) diff --git a/package.json b/package.json index b018109..1038de6 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,13 @@ "bl": "^1.1.2", "buffer-loader": "0.0.1", "chai": "^3.5.0", - "aegir": "^3.0.1", + "aegir": "^3.0.4", "gulp": "^3.9.1", "istanbul": "^0.4.3", "libp2p-multiplex": "^0.2.1", - "libp2p-spdy": "^0.3.1", + "libp2p-spdy": "^0.4.0", "libp2p-tcp": "^0.5.1", - "libp2p-websockets": "^0.4.4", + "libp2p-websockets": "^0.5.0", "pre-commit": "^1.1.2", "stream-pair": "^1.0.3" }, @@ -55,7 +55,7 @@ "duplex-passthrough": "github:diasdavid/duplex-passthrough", "ip-address": "^5.8.0", "lodash.contains": "^2.4.3", - "multiaddr": "^1.4.1", + "multiaddr": "^2.0.0", "multistream-select": "^0.6.5", "peer-id": "^0.6.6", "peer-info": "^0.6.2", @@ -79,4 +79,4 @@ "Richard Littauer ", "dignifiedquire " ] -} \ No newline at end of file +} diff --git a/test/01-transport-tcp.node.js b/test/01-transport-tcp.node.js index 2b18105..2afeaee 100644 --- a/test/01-transport-tcp.node.js +++ b/test/01-transport-tcp.node.js @@ -77,7 +77,7 @@ describe('transport - tcp', function () { it('dial to set of multiaddr, only one is available', (done) => { const conn = swarmA.transport.dial('tcp', [ - multiaddr('/ip4/127.0.0.1/tcp/9910/websockets'), // not valid on purpose + multiaddr('/ip4/127.0.0.1/tcp/9910/ws'), // not valid on purpose multiaddr('/ip4/127.0.0.1/tcp/9910'), multiaddr('/ip4/127.0.0.1/tcp/9999'), multiaddr('/ip4/127.0.0.1/tcp/9309') diff --git a/test/03-transport-websockets.node.js b/test/03-transport-websockets.node.js index 414bd27..eed2f2e 100644 --- a/test/03-transport-websockets.node.js +++ b/test/03-transport-websockets.node.js @@ -19,8 +19,8 @@ describe('transport - websockets', function () { var peerB = new Peer() before(() => { - peerA.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9888/websockets')) - peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9999/websockets/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC')) + peerA.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9888/ws')) + peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9999/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC')) swarmA = new Swarm(peerA) swarmB = new Swarm(peerB) }) @@ -45,13 +45,13 @@ describe('transport - websockets', function () { ], () => { expect(peerA.multiaddrs.length).to.equal(1) expect( - peerA.multiaddrs[0].equals(multiaddr('/ip4/127.0.0.1/tcp/9888/websockets')) + peerA.multiaddrs[0].equals(multiaddr('/ip4/127.0.0.1/tcp/9888/ws')) ).to.be.equal( true ) expect(peerB.multiaddrs.length).to.equal(1) expect( - peerB.multiaddrs[0].equals(multiaddr('/ip4/127.0.0.1/tcp/9999/websockets/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC')) + peerB.multiaddrs[0].equals(multiaddr('/ip4/127.0.0.1/tcp/9999/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC')) ).to.equal( true ) @@ -60,7 +60,7 @@ describe('transport - websockets', function () { }) it('dial', (done) => { - const conn = swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/websockets'), (err, conn) => { + const conn = swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/ws'), (err, conn) => { expect(err).to.not.exist }) conn.pipe(bl((err, data) => { @@ -72,7 +72,7 @@ describe('transport - websockets', function () { }) it('dial (conn from callback)', (done) => { - swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/websockets'), (err, conn) => { + swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/ws'), (err, conn) => { expect(err).to.not.exist conn.pipe(bl((err, data) => { diff --git a/test/09-swarm-with-muxing.node.js b/test/09-swarm-with-muxing.node.js index ce20c7b..e41abfd 100644 --- a/test/09-swarm-with-muxing.node.js +++ b/test/09-swarm-with-muxing.node.js @@ -74,10 +74,10 @@ describe('high level API - with everything mixed all together!', function () { it.skip('add utp', (done) => {}) it('add websockets', (done) => { - peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9012/websockets')) - peerC.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9022/websockets')) - peerD.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9032/websockets')) - peerE.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9042/websockets')) + peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9012/ws')) + peerC.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9022/ws')) + peerD.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9032/ws')) + peerE.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9042/ws')) swarmB.transport.add('ws', new WebSockets()) swarmC.transport.add('ws', new WebSockets()) diff --git a/test/browser.js b/test/browser.js index 39384b3..537ca8f 100644 --- a/test/browser.js +++ b/test/browser.js @@ -38,7 +38,7 @@ describe('transport - websockets', function () { }) it('dial', (done) => { - const ma = multiaddr('/ip4/127.0.0.1/tcp/9100/websockets') + const ma = multiaddr('/ip4/127.0.0.1/tcp/9100/ws') const conn = swarm.transport.dial('ws', ma, (err, conn) => { expect(err).to.not.exist @@ -83,7 +83,7 @@ describe('high level API - 1st without stream multiplexing (on websockets)', fun const idDst = Id.createFromB58String(b58IdDst) peerDst = new Peer(idDst) - const ma = multiaddr('/ip4/127.0.0.1/tcp/9200/websockets') + const ma = multiaddr('/ip4/127.0.0.1/tcp/9200/ws') peerDst.multiaddr.add(ma) })