diff --git a/client/client.go b/client/client.go index 25900246..f061ce97 100644 --- a/client/client.go +++ b/client/client.go @@ -10,6 +10,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "net/http" "strings" ) @@ -47,7 +48,9 @@ type Proxy struct { // with Toxiproxy. Endpoint is the address to the proxy (e.g. localhost:8474 if // not overriden) func NewClient(endpoint string) *Client { - if !strings.HasPrefix(endpoint, "http://") { + if strings.HasPrefix(endpoint, "https://") { + log.Fatal("the toxiproxy client does not support https") + } else if !strings.HasPrefix(endpoint, "http://") { endpoint = "http://" + endpoint } return &Client{endpoint: endpoint}