feat: WebSocketsSecure

This commit is contained in:
David Dias
2017-01-20 17:46:26 +00:00
parent ade442f4dd
commit 3b99a7335f
2 changed files with 34 additions and 4 deletions

View File

@@ -57,10 +57,16 @@ describe('multiaddr validation', function () {
'/ip6/::/tcp/0/ws'
]
const goodWSS = [
'/dns/ipfs.io/wss',
'/ip4/1.2.3.4/tcp/3456/wss',
'/ip6/::/tcp/0/wss'
]
const goodWebRTCStar = [
'/libp2p-webrtc-star/ip4/1.2.3.4/tcp/3456/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4',
'/libp2p-webrtc-star/dns/ipfs.io/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4',
'/libp2p-webrtc-star/dns/ipfs.io/wss/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4',
'/libp2p-webrtc-star/ip6/::/tcp/0/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo5'
]
@@ -134,6 +140,11 @@ describe('multiaddr validation', function () {
assertMismatches(mafmt.WebSockets, goodIP, goodUDP, badWS)
})
it('WebSocketsSecure validation', function () {
assertMatches(mafmt.WebSocketsSecure, goodWSS)
assertMismatches(mafmt.WebSocketsSecure, goodIP, goodUDP, badWS)
})
it('WebRTC-star validation', function () {
assertMatches(mafmt.WebRTCStar, goodWebRTCStar)
assertMismatches(mafmt.WebRTCStar, goodIP, goodUDP, badWS)