5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 15:20:30 +00:00

Also correct tcp: into tcp://

This commit is contained in:
Neil Alexander 2018-12-14 17:55:07 +00:00
parent 3ca5f10733
commit 1a7df477b0
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -196,6 +196,9 @@ func main() {
if strings.HasPrefix(uri, "tcp://") || strings.HasPrefix(uri, "socks://") {
continue
}
if strings.HasPrefix(uri, "tcp:") {
uri = uri[4:]
}
(dat["Peers"].([]interface{}))[index] = "tcp://" + uri
}
// Now do the same with the interface peers
@ -205,6 +208,9 @@ func main() {
if strings.HasPrefix(uri, "tcp://") || strings.HasPrefix(uri, "socks://") {
continue
}
if strings.HasPrefix(uri, "tcp:") {
uri = uri[4:]
}
((dat["InterfacePeers"].(map[string]interface{}))[intf]).([]interface{})[index] = "tcp://" + uri
}
}