⬆️ upgrade dependencies

This commit is contained in:
naiba
2023-05-10 00:34:04 +08:00
parent a25ec14016
commit 6346aab765
3 changed files with 41 additions and 35 deletions

View File

@@ -16,6 +16,7 @@ import (
"time"
"github.com/AlecAivazis/survey/v2"
bpc "github.com/DaRealFreak/cloudflare-bp-go"
"github.com/blang/semver"
"github.com/go-ping/ping"
"github.com/gorilla/websocket"
@@ -74,9 +75,11 @@ const (
)
func init() {
http.DefaultClient.Timeout = time.Second * 5
flag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
http.DefaultClient.Timeout = time.Second * 5
httpClient.Transport = bpc.AddCloudFlareByPass(httpClient.Transport)
ex, err := os.Executable()
if err != nil {
panic(err)
@@ -341,7 +344,7 @@ func handleIcmpPingTask(task *pb.Task, result *pb.TaskResult) {
if stat.PacketsRecv == 0 {
result.Data = "pockets recv 0"
return
}
}
result.Delay = float32(stat.AvgRtt.Microseconds()) / 1000.0
result.Successful = true
} else {