diff --git a/logs/test.log b/logs/test.log deleted file mode 100644 index e69de29..0000000 diff --git a/main.go b/main.go index 2f1808d..1f90494 100644 --- a/main.go +++ b/main.go @@ -71,9 +71,20 @@ func text_url(remarks string, country string, port int, done func()) { var port_string string = strconv.Itoa(port) setup.CwLog().Infof("start_testing country:%s,port:%d", country, port) request := gorequest.New().Proxy("socks5://127.0.0.1:" + port_string) + sum := 0 + for i := 0; i <= 3; i++ { + _, _, errs := request.Get(tooltt.Settings.DetectionNodeURL).End() + if errs != nil { + fmt.Println("发现 端口:" + port_string + "无法连接 第" + strconv.Itoa(sum) + "次数") + setup.CwLog().Errorf("start_testing country:%s,port:%d,error:%s", country, port, errs) + setup.CwLog().Infof("start_switching_ip country:%s,port:%d", country, port) + sum++ + } + + } resp, body, errs := request.Get(tooltt.Settings.DetectionNodeURL).End() if errs != nil { - fmt.Println("发现 端口:" + port_string + "无法连接 开始切换IP") + fmt.Println("发现 端口:" + port_string + "无法连接3次 开始切换IP") setup.CwLog().Errorf("start_testing country:%s,port:%d,error:%s", country, port, errs) setup.CwLog().Infof("start_switching_ip country:%s,port:%d", country, port) diff --git a/user.json b/user.json index 2521ebc..1ab45e2 100644 --- a/user.json +++ b/user.json @@ -14,6 +14,26 @@ "remarks": "giao2", "country": "UK", "port": 30001 + }, + { + "remarks": "giao2", + "country": "UK", + "port": 30002 + }, + { + "remarks": "giao2", + "country": "UK", + "port": 30003 + }, + { + "remarks": "giao2", + "country": "UK", + "port": 30004 + }, + { + "remarks": "giao2", + "country": "UK", + "port": 30005 } ] }