From 00195fac4c166ca3ff4d3fa82fa512e4532b3b02 Mon Sep 17 00:00:00 2001 From: giaogiao Date: Sat, 18 Nov 2023 10:02:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logs/test.log | 0 main.go | 13 ++++++++++++- user.json | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) delete mode 100644 logs/test.log 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 } ] }