Skip to content

Commit

Permalink
feat: add support for quic addresses
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
  • Loading branch information
lidel committed Nov 3, 2018
1 parent 667965b commit 9238d0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/protocols-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Protocols.table = [
[421, Protocols.lengthPrefixedVarSize, 'ipfs'],
[480, 0, 'http'],
[443, 0, 'https'],
[460, 0, 'quic'],
[477, 0, 'ws'],
[478, 0, 'wss'],
[479, 0, 'p2p-websocket-star'],
Expand Down
7 changes: 7 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ describe('variants', () => {
expect(addr.toString()).to.equal(str)
})

it('ip6 + udp + quic + ipfs', () => {
const str = '/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/udp/4001/quic/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC'
const addr = multiaddr(str)
expect(addr).to.have.property('buffer')
expect(addr.toString()).to.equal(str)
})

it('ipfs', () => {
const str = '/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC'
const addr = multiaddr(str)
Expand Down

0 comments on commit 9238d0d

Please sign in to comment.