diff --git a/cmd/client.go b/cmd/client.go index b423cc6..83fd83f 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -11,6 +11,7 @@ import ( "sort" "strings" "text/tabwriter" + "time" "github.com/robfig/cron/v3" "github.com/spf13/cobra" @@ -187,7 +188,11 @@ func GetPublicIP() (string, error) { if secure { protocol = "https://" } - res, err := http.Get(protocol + host + ":" + port + "?name=" + name) + req, _ := http.NewRequest("GET", protocol+host+":"+port+"?name="+name, nil) + client := &http.Client{ + Timeout: time.Second * 10, + } + res, err := client.Do(req) if err != nil { log.Println(err) return "", err