mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-07 06:00:06 +00:00
增强 IP 获取健壮性
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -27,12 +26,6 @@ var ipv6Servers = []string{
|
|||||||
var cachedIP, cachedCountry string
|
var cachedIP, cachedCountry string
|
||||||
|
|
||||||
func UpdateIP() {
|
func UpdateIP() {
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
log.Println(cachedIP, cachedCountry)
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
for {
|
for {
|
||||||
ipv4 := fetchGeoIP(ipv4Servers)
|
ipv4 := fetchGeoIP(ipv4Servers)
|
||||||
ipv6 := fetchGeoIP(ipv6Servers)
|
ipv6 := fetchGeoIP(ipv6Servers)
|
||||||
|
|||||||
Reference in New Issue
Block a user