diff --git a/src/protocols.csv b/src/protocols.csv index 0f9e1ea9..272efd44 100644 --- a/src/protocols.csv +++ b/src/protocols.csv @@ -12,3 +12,4 @@ code size name 443 0 https 477 0 ws 444 10 onion +275 0 libp2p-webrtc-star diff --git a/src/protocols.js b/src/protocols.js index 39f07b02..a470a279 100644 --- a/src/protocols.js +++ b/src/protocols.js @@ -41,7 +41,8 @@ Protocols.table = [ [421, Protocols.lengthPrefixedVarSize, 'ipfs'], [480, 0, 'http'], [443, 0, 'https'], - [477, 0, 'ws'] + [477, 0, 'ws'], + [275, 0, 'libp2p-webrtc-star'] ] Protocols.names = {} diff --git a/test/index.spec.js b/test/index.spec.js index e0582264..5744195b 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -284,6 +284,13 @@ describe('variants', () => { expect(addr).to.have.property('buffer') expect(addr.toString()).to.equal(str) }) + + it('webrtc-star', () => { + const str = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/9090/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC' + const addr = multiaddr(str) + expect(addr).to.have.property('buffer') + expect(addr.toString()).to.equal(str) + }) }) describe('helpers', () => {