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
152990b9
Unverified
Commit
152990b9
authored
Dec 27, 2018
by
Steven Allen
Committed by
GitHub
Dec 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #93 from backkem/p2p-webrtc-direct
Add p2p-webrtc-direct protocol
parents
312b9db3
6b421eae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
multiaddr_test.go
multiaddr_test.go
+2
-0
protocols.go
protocols.go
+25
-18
No files found.
multiaddr_test.go
View file @
152990b9
...
...
@@ -68,6 +68,7 @@ func TestConstructFails(t *testing.T) {
"/ip4/127.0.0.1/p2p/tcp"
,
"/unix"
,
"/ip4/1.2.3.4/tcp/80/unix"
,
"/ip4/127.0.0.1/tcp/9090/http/p2p-webcrt-direct"
,
}
for
_
,
a
:=
range
cases
{
...
...
@@ -127,6 +128,7 @@ func TestConstructSucceeds(t *testing.T) {
"/ip4/1.2.3.4/tcp/80/unix/a/b/c/d/e/f"
,
"/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio"
,
"/ip4/127.0.0.1/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234/unix/stdio"
,
"/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct"
,
}
for
_
,
a
:=
range
cases
{
...
...
protocols.go
View file @
152990b9
...
...
@@ -24,6 +24,7 @@ const (
P_ONION
=
0x01BC
// also for backwards compatibility
P_ONION3
=
0x01BD
P_GARLIC64
=
0x01CA
P_P2P_WEBRTC_DIRECT
=
0x0114
)
var
(
...
...
@@ -143,6 +144,11 @@ var (
Path
:
true
,
Transcoder
:
TranscoderUnix
,
}
protoP2P_WEBRTC_DIRECT
=
Protocol
{
Name
:
"p2p-webrtc-direct"
,
Code
:
P_P2P_WEBRTC_DIRECT
,
VCode
:
CodeToVarint
(
P_P2P_WEBRTC_DIRECT
),
}
)
func
init
()
{
...
...
@@ -164,6 +170,7 @@ func init() {
protoHTTPS
,
protoP2P
,
protoUNIX
,
protoP2P_WEBRTC_DIRECT
,
}
{
if
err
:=
AddProtocol
(
p
);
err
!=
nil
{
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