Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p-quic-transport
Commits
b9d0283f
Unverified
Commit
b9d0283f
authored
Jun 20, 2018
by
Marten Seemann
Committed by
GitHub
Jun 20, 2018
Browse files
Merge pull request #16 from libp2p/multiaddr-encapsulate
use multiaddr.Encapsulate to create QUIC multiaddrs
parents
782b1004
fc41d585
Changes
1
Hide whitespace changes
Inline
Side-by-side
conn.go
View file @
b9d0283f
...
...
@@ -82,15 +82,14 @@ func (c *conn) Transport() tpt.Transport {
return
c
.
transport
}
// TODO: there must be a better way to do this
func
quicMultiaddr
(
na
net
.
Addr
)
(
ma
.
Multiaddr
,
error
)
{
udpMA
,
err
:=
manet
.
FromNetAddr
(
na
)
if
err
!=
nil
{
return
nil
,
err
}
quicMA
,
err
:=
ma
.
NewMultiaddr
(
udpMA
.
String
()
+
"/quic"
)
quicMA
,
err
:=
ma
.
NewMultiaddr
(
"/quic"
)
if
err
!=
nil
{
return
nil
,
err
}
return
quicMA
,
nil
return
udpMA
.
Encapsulate
(
quicMA
)
,
nil
}
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