Commit cca60aba authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #9 from ehmry/master

ipv6 support for DialArgs
parents baeeb60a 81e75c71
......@@ -93,7 +93,14 @@ func (m *Multiaddr) DialArgs() (string, string, error) {
parts := strings.Split(str, "/")[1:]
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
}
......
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