Skip to content

Commit

Permalink
Make https works again; save error from resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Nov 7, 2021
1 parent fc3150e commit 5f43353
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ type AWSTarget struct {
// CheckLatencyHTTP Test Latency via HTTP
func (r *AWSRegion) CheckLatencyHTTP(wg *sync.WaitGroup, https bool) {
defer wg.Done()
url := fmt.Sprintf("http://%s/ping?x=%s", r.GetTarget().Hostname, mkRandoString(13))
proto := "http"
if https {
proto = "https"
}
url := fmt.Sprintf("%s://%s/ping?x=%s", proto, r.GetTarget().Hostname, mkRandoString(13))

client := &http.Client{}

Expand All @@ -48,7 +52,10 @@ func (r *AWSRegion) CheckLatencyHTTP(wg *sync.WaitGroup, https bool) {
func (r *AWSRegion) GetTarget() AWSTarget {

hostname := fmt.Sprintf("%s.%s.amazonaws.com", r.Service, r.Code)
ipAddr, _ := net.ResolveIPAddr("ip4", hostname)
ipAddr, err := net.ResolveIPAddr("ip4", hostname)
if err != nil {
r.Error = err
}

return AWSTarget{
Hostname: hostname,
Expand Down

0 comments on commit 5f43353

Please sign in to comment.