pull/5/head
Evan Chen 2021-10-16 22:47:30 +08:00
parent 390c4eceda
commit 7c0534df73
1 changed files with 6 additions and 1 deletions

View File

@ -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