Skip to content

Commit

Permalink
Allow HTTPS endpoints in client
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Chen committed Oct 25, 2021
1 parent 5a3ea8a commit dbf5b1c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ type Proxy struct {
// with Toxiproxy. Endpoint is the address to the proxy (e.g. localhost:8474 if
// not overridden).
func NewClient(endpoint string) *Client {
if strings.HasPrefix(endpoint, "https://") {
log.Fatal("the toxiproxy client does not support https")
} else if !strings.HasPrefix(endpoint, "http://") {
if !strings.HasPrefix(endpoint, "https://") && !strings.HasPrefix(endpoint, "http://") {
endpoint = "http://" + endpoint
}
return &Client{endpoint: endpoint}
Expand Down

0 comments on commit dbf5b1c

Please sign in to comment.