in client.go [91:118]
func getServerIPandPort(server string) (string, string, string, error) {
hostName := ""
hostIP := ""
port := ""
u, err := url.Parse(server)
if err == nil && u.Hostname() != "" {
hostName = u.Hostname()
if u.Port() != "" {
port = u.Port()
} else {
// Only implicitly derive port in External client mode.
if gIsExternalClient {
if u.Scheme == "http" {
port = "80"
} else if u.Scheme == "https" {
port = "443"
}
}
}
} else {
hostName, port, err = net.SplitHostPort(server)
if err != nil {
hostName = server
}
}
_, hostIP, err = ethrLookupIP(hostName)
return hostName, hostIP, port, err
}