use ip if exec nslookup

This commit is contained in:
zu1k
2020-09-07 12:44:55 +08:00
parent 5514bbff60
commit 240ac61ec0

View File

@@ -71,13 +71,17 @@ func (ps ProxyList) NameAddCounrty() ProxyList {
ii := i
go func() {
defer wg.Done()
_, country, err := geoIp.Find(ps[ii].BaseInfo().Server)
ip, country, err := geoIp.Find(ps[ii].BaseInfo().Server)
if err != nil {
country = "🏁 ZZ"
}
ps[ii].SetName(fmt.Sprintf("%s", country))
ps[ii].SetCountry(country)
//ps[ii].SetIP(ip)
// trojan依赖域名
if ps[ii].TypeName() != "trojan" {
ps[ii].SetIP(ip)
}
}()
}
wg.Wait()