We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2800d37 commit e7598baCopy full SHA for e7598ba
client_public_ip.go
@@ -9,6 +9,7 @@ package main
9
10
import (
11
"encoding/json"
12
+ "fmt"
13
"io/ioutil"
14
"net/http"
15
)
@@ -20,9 +21,9 @@ type ipInfo struct {
20
21
22
// Retrieve the client machine's public IPv4 address.
23
func getClientPublicIPv4Address() (string, error) {
- response, err := http.Get("http://ifconfig.co/json")
24
+ response, err := http.Get("https://ifconfig.co/json")
25
if err != nil {
- return "", err
26
+ return "", fmt.Errorf("Unable to connect to ifconfig.co to determine your IP address: %s", err.Error())
27
}
28
defer response.Body.Close()
29
0 commit comments