Merge pull request #165 from multiformats/plaintextv2

add the plaintextv2 protocol
This commit is contained in:
Marten Seemann 2021-09-20 09:52:15 +01:00 committed by GitHub
commit fc723035a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,7 @@ const (
P_NOISE = 0x01c6
P_WS = 0x01DD
P_WSS = 0x01DE // deprecated alias for /tls/ws
P_PLAINTEXTV2 = 0x706c61
)
var (
@ -209,6 +210,11 @@ var (
Code: P_NOISE,
VCode: CodeToVarint(P_NOISE),
}
protoPlaintextV2 = Protocol{
Name: "plaintextv2",
Code: P_PLAINTEXTV2,
VCode: CodeToVarint(P_PLAINTEXTV2),
}
protoWS = Protocol{
Name: "ws",
Code: P_WS,
@ -251,6 +257,7 @@ func init() {
protoNOISE,
protoWS,
protoWSS,
protoPlaintextV2,
} {
if err := AddProtocol(p); err != nil {
panic(err)