Commit 81e75c71 authored by Emery Hemingway's avatar Emery Hemingway

ipv6 support for DialArgs

parent baeeb60a
...@@ -93,7 +93,14 @@ func (m *Multiaddr) DialArgs() (string, string, error) { ...@@ -93,7 +93,14 @@ func (m *Multiaddr) DialArgs() (string, string, error) {
parts := strings.Split(str, "/")[1:] parts := strings.Split(str, "/")[1:]
network := parts[2] network := parts[2]
host := strings.Join([]string{parts[1], parts[3]}, ":")
var host string
switch parts[0] {
case "ip4":
host = strings.Join([]string{parts[1], parts[3]}, ":")
case "ip6":
host = fmt.Sprintf("[%s]:%s", parts[1], parts[3])
}
return network, host, nil return network, host, nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment