【升级go 1.18】

This commit is contained in:
PandaGoAdmin
2022-07-13 11:54:54 +08:00
parent 2e18999587
commit 433ee08634
60 changed files with 253 additions and 248 deletions

View File

@@ -10,12 +10,13 @@ const ipurl = "http://whois.pconline.com.cn/ipJson.jsp"
const UNKNOWN = "XX XX"
//获取真实地址
//GetRealAddressByIP 获取真实地址
func GetRealAddressByIP(ip string) string {
if ip == "127.0.0.1" || ip == "localhost" {
return "内部IP"
}
url := fmt.Sprintf("%s?ip=%s&json=true", ipurl, ip)
res := httpclient.NewRequest(url).Get()
if res == nil || res.StatusCode != 200 {
return UNKNOWN