This commit is contained in:
parent
4b25cd5c1b
commit
00195fac4c
13
main.go
13
main.go
|
@ -71,9 +71,20 @@ func text_url(remarks string, country string, port int, done func()) {
|
||||||
var port_string string = strconv.Itoa(port)
|
var port_string string = strconv.Itoa(port)
|
||||||
setup.CwLog().Infof("start_testing country:%s,port:%d", country, port)
|
setup.CwLog().Infof("start_testing country:%s,port:%d", country, port)
|
||||||
request := gorequest.New().Proxy("socks5://127.0.0.1:" + port_string)
|
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()
|
resp, body, errs := request.Get(tooltt.Settings.DetectionNodeURL).End()
|
||||||
if errs != nil {
|
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().Errorf("start_testing country:%s,port:%d,error:%s", country, port, errs)
|
||||||
setup.CwLog().Infof("start_switching_ip country:%s,port:%d", country, port)
|
setup.CwLog().Infof("start_switching_ip country:%s,port:%d", country, port)
|
||||||
|
|
||||||
|
|
20
user.json
20
user.json
|
@ -14,6 +14,26 @@
|
||||||
"remarks": "giao2",
|
"remarks": "giao2",
|
||||||
"country": "UK",
|
"country": "UK",
|
||||||
"port": 30001
|
"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
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue