Skip to content

Commit

Permalink
feat: add webrtc-direct multiaddr (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias authored Jan 16, 2017
1 parent b8edb7e commit fb0e667
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Protocols.table = [
[480, 0, 'http'],
[443, 0, 'https'],
[477, 0, 'ws'],
[275, 0, 'libp2p-webrtc-star']
[275, 0, 'libp2p-webrtc-star'],
[276, 0, 'libp2p-webrtc-direct']
]

Protocols.names = {}
Expand Down
7 changes: 7 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ describe('variants', () => {
expect(addr).to.have.property('buffer')
expect(addr.toString()).to.equal(str)
})

it('webrtc-direct', () => {
const str = '/libp2p-webrtc-direct/ip4/127.0.0.1/tcp/9090/http'
const addr = multiaddr(str)
expect(addr).to.have.property('buffer')
expect(addr.toString()).to.equal(str)
})
})

describe('helpers', () => {
Expand Down

0 comments on commit fb0e667

Please sign in to comment.