Skip to content

Commit 0c909e5

Browse files
committed
add webrtc-star multiaddr for libp2p-webrtc-star transport
1 parent 638ad5e commit 0c909e5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/protocols.csv

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ code size name
1212
443 0 https
1313
477 0 ws
1414
444 10 onion
15+
275 0 libp2p-webrtc-star

src/protocols.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ Protocols.table = [
4141
[421, Protocols.lengthPrefixedVarSize, 'ipfs'],
4242
[480, 0, 'http'],
4343
[443, 0, 'https'],
44-
[477, 0, 'ws']
44+
[477, 0, 'ws'],
45+
[275, 0, 'libp2p-webrtc-star']
4546
]
4647

4748
Protocols.names = {}

test/index.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ describe('variants', () => {
284284
expect(addr).to.have.property('buffer')
285285
expect(addr.toString()).to.equal(str)
286286
})
287+
288+
it('webrtc-star', () => {
289+
const str = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/9090/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC'
290+
const addr = multiaddr(str)
291+
expect(addr).to.have.property('buffer')
292+
expect(addr.toString()).to.equal(str)
293+
})
287294
})
288295

289296
describe('helpers', () => {

0 commit comments

Comments
 (0)