Skip to content

Commit 369d996

Browse files
committed
Merge pull request #21 from jbenet/webrtc-star
add webrtc-star multiaddr for libp2p-webrtc-star transport
2 parents 638ad5e + 0c909e5 commit 369d996

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/protocols.csv

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 7 additions & 0 deletions
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)