Skip to content
Permalink
Browse files
This closes #64
  • Loading branch information
tbouron committed Nov 10, 2017
2 parents 18967df + 925c8ca commit cedb35079e43f57b29005b3e87e9bf4722d99828
Showing 1 changed file with 10 additions and 0 deletions.
@@ -34,6 +34,7 @@ import (
"crypto/tls"
"net"
"time"
"strings"
)

type Network struct {
@@ -279,6 +280,15 @@ func VerifyLoginURL(network *Network) error {
if url.Host == "" {
return errors.New("Use login command to set Brooklyn URL with a valid host[:port]")
}
if len(strings.Split(url.Host, ":")) < 2 {
if url.Scheme == "https" {
url.Host += ":443"
network.BrooklynUrl = url.String()
} else if url.Scheme == "http" {
url.Host += ":80"
network.BrooklynUrl = url.String()
}
}
_, err = net.DialTimeout("tcp", url.Host, time.Duration(30) * time.Second)
if err != nil {
return errors.New("Could not connect to " + url.Host)

0 comments on commit cedb350

Please sign in to comment.