Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
fc723035
Unverified
Commit
fc723035
authored
Sep 20, 2021
by
Marten Seemann
Committed by
GitHub
Sep 20, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #165 from multiformats/plaintextv2
add the plaintextv2 protocol
parents
d7eafbb3
a40b139c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
protocols.go
protocols.go
+7
-0
No files found.
protocols.go
View file @
fc723035
...
@@ -32,6 +32,7 @@ const (
...
@@ -32,6 +32,7 @@ const (
P_NOISE
=
0x01c6
P_NOISE
=
0x01c6
P_WS
=
0x01DD
P_WS
=
0x01DD
P_WSS
=
0x01DE
// deprecated alias for /tls/ws
P_WSS
=
0x01DE
// deprecated alias for /tls/ws
P_PLAINTEXTV2
=
0x706c61
)
)
var
(
var
(
...
@@ -209,6 +210,11 @@ var (
...
@@ -209,6 +210,11 @@ var (
Code
:
P_NOISE
,
Code
:
P_NOISE
,
VCode
:
CodeToVarint
(
P_NOISE
),
VCode
:
CodeToVarint
(
P_NOISE
),
}
}
protoPlaintextV2
=
Protocol
{
Name
:
"plaintextv2"
,
Code
:
P_PLAINTEXTV2
,
VCode
:
CodeToVarint
(
P_PLAINTEXTV2
),
}
protoWS
=
Protocol
{
protoWS
=
Protocol
{
Name
:
"ws"
,
Name
:
"ws"
,
Code
:
P_WS
,
Code
:
P_WS
,
...
@@ -251,6 +257,7 @@ func init() {
...
@@ -251,6 +257,7 @@ func init() {
protoNOISE
,
protoNOISE
,
protoWS
,
protoWS
,
protoWSS
,
protoWSS
,
protoPlaintextV2
,
}
{
}
{
if
err
:=
AddProtocol
(
p
);
err
!=
nil
{
if
err
:=
AddProtocol
(
p
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment