feat: #1
parent
8aa35a546f
commit
631261d8af
|
@ -11,6 +11,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -187,7 +188,11 @@ func GetPublicIP() (string, error) {
|
||||||
if secure {
|
if secure {
|
||||||
protocol = "https://"
|
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 {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Reference in New Issue