Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
Merge pull request #58 from diasdavid/update-deps
Browse files Browse the repository at this point in the history
update deps to support latest multiaddr
  • Loading branch information
daviddias committed May 18, 2016
2 parents 8d792fe + f619330 commit 1eacc5b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand All @@ -79,4 +79,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"dignifiedquire <dignifiedquire@gmail.com>"
]
}
}
2 changes: 1 addition & 1 deletion test/01-transport-tcp.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
12 changes: 6 additions & 6 deletions test/03-transport-websockets.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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
)
Expand All @@ -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) => {
Expand All @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions test/09-swarm-with-muxing.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})

Expand Down

0 comments on commit 1eacc5b

Please sign in to comment.