@@ -140,6 +140,7 @@ func TestConstructSucceeds(t *testing.T) {
140
140
"/udp/1234/udt" ,
141
141
"/udp/1234/utp" ,
142
142
"/tcp/1234/http" ,
143
+ "/tcp/1234/tls/http" ,
143
144
"/tcp/1234/https" ,
144
145
"/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234" ,
145
146
"/ipfs/k2k4r8oqamigqdo6o7hsbfwd45y70oyynp98usk7zmyfrzpqxh1pohl7/tcp/1234" ,
@@ -168,6 +169,7 @@ func TestConstructSucceeds(t *testing.T) {
168
169
"/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct" ,
169
170
"/ip4/127.0.0.1/tcp/127/ws" ,
170
171
"/ip4/127.0.0.1/tcp/127/ws" ,
172
+ "/ip4/127.0.0.1/tcp/127/tls/ws" ,
171
173
"/ip4/127.0.0.1/tcp/127/wss" ,
172
174
"/ip4/127.0.0.1/tcp/127/wss" ,
173
175
}
@@ -425,9 +427,10 @@ func assertValueForProto(t *testing.T, a Multiaddr, p int, exp string) {
425
427
}
426
428
427
429
func TestGetValue (t * testing.T ) {
428
- a := newMultiaddr (t , "/ip4/127.0.0.1/utp/tcp/5555/udp/1234/utp/ipfs/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP" )
430
+ a := newMultiaddr (t , "/ip4/127.0.0.1/utp/tcp/5555/udp/1234/tls/ utp/ipfs/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP" )
429
431
assertValueForProto (t , a , P_IP4 , "127.0.0.1" )
430
432
assertValueForProto (t , a , P_UTP , "" )
433
+ assertValueForProto (t , a , P_TLS , "" )
431
434
assertValueForProto (t , a , P_TCP , "5555" )
432
435
assertValueForProto (t , a , P_UDP , "1234" )
433
436
assertValueForProto (t , a , P_IPFS , "QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP" )
@@ -528,6 +531,7 @@ func TestRoundTrip(t *testing.T) {
528
531
"/unix/a/b/c/d" ,
529
532
"/ip6/::ffff:127.0.0.1/tcp/111" ,
530
533
"/ip4/127.0.0.1/tcp/123" ,
534
+ "/ip4/127.0.0.1/tcp/123/tls" ,
531
535
"/ip4/127.0.0.1/udp/123" ,
532
536
"/ip4/127.0.0.1/udp/123/ip6/::" ,
533
537
"/p2p/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP" ,
@@ -630,7 +634,7 @@ func TestZone(t *testing.T) {
630
634
}
631
635
632
636
func TestBinaryMarshaler (t * testing.T ) {
633
- addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001" )
637
+ addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001/tls " )
634
638
b , err := addr .MarshalBinary ()
635
639
if err != nil {
636
640
t .Fatal (err )
@@ -646,7 +650,7 @@ func TestBinaryMarshaler(t *testing.T) {
646
650
}
647
651
648
652
func TestTextMarshaler (t * testing.T ) {
649
- addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001" )
653
+ addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001/tls " )
650
654
b , err := addr .MarshalText ()
651
655
if err != nil {
652
656
t .Fatal (err )
@@ -662,7 +666,7 @@ func TestTextMarshaler(t *testing.T) {
662
666
}
663
667
664
668
func TestJSONMarshaler (t * testing.T ) {
665
- addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001" )
669
+ addr := newMultiaddr (t , "/ip4/0.0.0.0/tcp/4001/tls " )
666
670
b , err := addr .MarshalJSON ()
667
671
if err != nil {
668
672
t .Fatal (err )
0 commit comments