@@ -44,19 +44,35 @@ var TestVectors = map[string]*testVector{
44
44
"/ip4/1.2.3.4/tcp/1234/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
45
45
"/ip6/::/tcp/1234/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
46
46
"/ip6/::/udp/1234/utp/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
47
- "/ip4/0.0.0.0/udp/1234/utp/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" },
47
+ "/ip4/0.0.0.0/udp/1234/utp/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
48
+ },
48
49
Bad : []string {
49
50
"/ip4/1.2.3.4/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
50
51
"/ip6/::/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
51
52
"/tcp/123/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
52
53
"/ip6/::/udp/1234/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
53
54
"/ip6/::/utp/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
54
- "/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" }},
55
+ "/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" ,
56
+ },
57
+ },
55
58
"DNS" : {
56
59
Pattern : DNS ,
57
- Good : []string {"/dnsaddr/ipfs .io" , "/dns4/ipfs .io" , "/dns4/libp2p.io" , "/ dns6/protocol.ai " },
60
+ Good : []string {"/dnsaddr/example .io" , "/dns4/example .io" , "/dns6/example.io " },
58
61
Bad : []string {"/ip4/127.0.0.1" },
59
62
},
63
+ "WebRTCDirect" : {
64
+ Pattern : WebRTCDirect ,
65
+ Good : []string {"/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct" , "/ip6/::/tcp/0/http/p2p-webrtc-direct" },
66
+ Bad : []string {"/ip4/0.0.0.0" , "/ip6/fc00::" , "/udp/12345" , "/ip6/fc00::/tcp/5523/udp/9543" },
67
+ },
68
+ "HTTP" : {
69
+ Pattern : HTTP ,
70
+ Good : []string {"/ip4/1.2.3.4/http" , "/dns4/example.io/http" , "/dns6/::/tcp/7011/http" , "/dnsaddr/example.io/http" , "/ip6/fc00::/http" },
71
+ },
72
+ "HTTPS" : {
73
+ Pattern : HTTPS ,
74
+ Good : []string {"/ip4/1.2.3.4/https" , "/dns4/example.io/https" , "/dns6/::/tcp/7011/https" , "/ip6/fc00::/https" },
75
+ },
60
76
}
61
77
62
78
func TestProtocolMatching (t * testing.T ) {
0 commit comments