This commit is contained in:
giaogiao 2023-11-18 10:02:59 +08:00
parent 4b25cd5c1b
commit 00195fac4c
3 changed files with 32 additions and 1 deletions

View File

13
main.go
View File

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

View File

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