add support for WebTransport

This commit is contained in:
Marten Seemann 2022-04-06 12:37:31 +01:00
parent f5adc3b7a2
commit e0eb8cdf5d
2 changed files with 8 additions and 0 deletions

View File

@ -157,6 +157,7 @@ func TestConstructSucceeds(t *testing.T) {
"/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/udp/1234/quic/webtransport",
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC",
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234",
"/ip4/127.0.0.1/ipfs/k2k4r8oqamigqdo6o7hsbfwd45y70oyynp98usk7zmyfrzpqxh1pohl7",

View File

@ -15,6 +15,7 @@ const (
P_IP6ZONE = 0x002A
P_IPCIDR = 0x002B
P_QUIC = 0x01CC
P_WEBTRANSPORT = 0x01D1
P_SCTP = 0x0084
P_CIRCUIT = 0x0122
P_UDT = 0x012D
@ -178,6 +179,11 @@ var (
Code: P_QUIC,
VCode: CodeToVarint(P_QUIC),
}
protoWEBTRANSPORT = Protocol{
Name: "webtransport",
Code: P_WEBTRANSPORT,
VCode: CodeToVarint(P_WEBTRANSPORT),
}
protoHTTP = Protocol{
Name: "http",
Code: P_HTTP,
@ -257,6 +263,7 @@ func init() {
protoUTP,
protoUDT,
protoQUIC,
protoWEBTRANSPORT,
protoHTTP,
protoHTTPS,
protoP2P,