add QUIC

parent 5ea81f9b
...@@ -28,6 +28,7 @@ func TestConstructFails(t *testing.T) { ...@@ -28,6 +28,7 @@ func TestConstructFails(t *testing.T) {
"/sctp", "/sctp",
"/udp/65536", "/udp/65536",
"/tcp/65536", "/tcp/65536",
"/quic/65536",
"/onion/9imaq4ygg2iegci7:80", "/onion/9imaq4ygg2iegci7:80",
"/onion/aaimaq4ygg2iegci7:80", "/onion/aaimaq4ygg2iegci7:80",
"/onion/timaq4ygg2iegci7:0", "/onion/timaq4ygg2iegci7:0",
...@@ -41,6 +42,7 @@ func TestConstructFails(t *testing.T) { ...@@ -41,6 +42,7 @@ func TestConstructFails(t *testing.T) {
"/ip4/127.0.0.1/udp", "/ip4/127.0.0.1/udp",
"/ip4/127.0.0.1/tcp/jfodsajfidosajfoidsa", "/ip4/127.0.0.1/tcp/jfodsajfidosajfoidsa",
"/ip4/127.0.0.1/tcp", "/ip4/127.0.0.1/tcp",
"/ip4/127.0.0.1/quic/1234",
"/ip4/127.0.0.1/ipfs", "/ip4/127.0.0.1/ipfs",
"/ip4/127.0.0.1/ipfs/tcp", "/ip4/127.0.0.1/ipfs/tcp",
"/unix", "/unix",
...@@ -60,6 +62,7 @@ func TestConstructSucceeds(t *testing.T) { ...@@ -60,6 +62,7 @@ func TestConstructSucceeds(t *testing.T) {
"/ip4/0.0.0.0", "/ip4/0.0.0.0",
"/ip6/::1", "/ip6/::1",
"/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21", "/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21",
"/ip6/2601:9:4f81:9700:803e:ca65:66e8:c21/udp/1234/quic",
"/onion/timaq4ygg2iegci7:1234", "/onion/timaq4ygg2iegci7:1234",
"/onion/timaq4ygg2iegci7:80/http", "/onion/timaq4ygg2iegci7:80/http",
"/udp/0", "/udp/0",
...@@ -81,6 +84,7 @@ func TestConstructSucceeds(t *testing.T) { ...@@ -81,6 +84,7 @@ func TestConstructSucceeds(t *testing.T) {
"/ip4/127.0.0.1/udp/0", "/ip4/127.0.0.1/udp/0",
"/ip4/127.0.0.1/tcp/1234", "/ip4/127.0.0.1/tcp/1234",
"/ip4/127.0.0.1/tcp/1234/", "/ip4/127.0.0.1/tcp/1234/",
"/ip4/127.0.0.1/udp/1234/quic",
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC", "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC",
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234", "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234",
"/unix/a/b/c/d/e", "/unix/a/b/c/d/e",
......
...@@ -26,6 +26,7 @@ const ( ...@@ -26,6 +26,7 @@ const (
P_UDP = 17 P_UDP = 17
P_DCCP = 33 P_DCCP = 33
P_IP6 = 41 P_IP6 = 41
P_QUIC = 81
P_SCTP = 132 P_SCTP = 132
P_UTP = 301 P_UTP = 301
P_UDT = 302 P_UDT = 302
...@@ -53,6 +54,7 @@ var Protocols = []Protocol{ ...@@ -53,6 +54,7 @@ var Protocols = []Protocol{
Protocol{P_ONION, 96, "onion", CodeToVarint(P_ONION), false, TranscoderOnion}, Protocol{P_ONION, 96, "onion", CodeToVarint(P_ONION), false, TranscoderOnion},
Protocol{P_UTP, 0, "utp", CodeToVarint(P_UTP), false, nil}, Protocol{P_UTP, 0, "utp", CodeToVarint(P_UTP), false, nil},
Protocol{P_UDT, 0, "udt", CodeToVarint(P_UDT), false, nil}, Protocol{P_UDT, 0, "udt", CodeToVarint(P_UDT), false, nil},
Protocol{P_QUIC, 0, "quic", CodeToVarint(P_QUIC), false, nil},
Protocol{P_HTTP, 0, "http", CodeToVarint(P_HTTP), false, nil}, Protocol{P_HTTP, 0, "http", CodeToVarint(P_HTTP), false, nil},
Protocol{P_HTTPS, 0, "https", CodeToVarint(P_HTTPS), false, nil}, Protocol{P_HTTPS, 0, "https", CodeToVarint(P_HTTPS), false, nil},
Protocol{P_IPFS, LengthPrefixedVarSize, "ipfs", CodeToVarint(P_IPFS), false, TranscoderIPFS}, Protocol{P_IPFS, LengthPrefixedVarSize, "ipfs", CodeToVarint(P_IPFS), false, TranscoderIPFS},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment