Skip to content

Commit fb0e667

Browse files
authored
feat: add webrtc-direct multiaddr (#36)
1 parent b8edb7e commit fb0e667

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: src/protocols.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Protocols.table = [
4242
[480, 0, 'http'],
4343
[443, 0, 'https'],
4444
[477, 0, 'ws'],
45-
[275, 0, 'libp2p-webrtc-star']
45+
[275, 0, 'libp2p-webrtc-star'],
46+
[276, 0, 'libp2p-webrtc-direct']
4647
]
4748

4849
Protocols.names = {}

Diff for: test/index.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ describe('variants', () => {
292292
expect(addr).to.have.property('buffer')
293293
expect(addr.toString()).to.equal(str)
294294
})
295+
296+
it('webrtc-direct', () => {
297+
const str = '/libp2p-webrtc-direct/ip4/127.0.0.1/tcp/9090/http'
298+
const addr = multiaddr(str)
299+
expect(addr).to.have.property('buffer')
300+
expect(addr.toString()).to.equal(str)
301+
})
295302
})
296303

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

0 commit comments

Comments
 (0)