SNI和DNS不再分离,统一使用api.nxtrace.org

This commit is contained in:
tsosunchia
2025-07-08 11:30:21 +08:00
parent adf8bb7076
commit b4d2038895
3 changed files with 5 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ func GetMapUrl(r string) (string, error) {
if len(strings.Split(fastIp, ":")) > 1 {
fastIp = "[" + fastIp + "]"
}
host = "origin-fallback.nxtrace.org"
host = "api.nxtrace.org"
} else {
// 默认配置完成,开始寻找最优 IP
fastIp = util.GetFastIP(host, port, false)

View File

@@ -30,7 +30,7 @@ var FastIpCache = ""
func GetFastIP(domain string, port string, enableOutput bool) string {
proxyUrl := GetProxy()
if proxyUrl != nil {
return "origin-fallback.nxtrace.org"
return "api.nxtrace.org"
}
if FastIpCache != "" {
return FastIpCache
@@ -38,7 +38,7 @@ func GetFastIP(domain string, port string, enableOutput bool) string {
var ips []net.IP
var err error
if domain == "origin-fallback.nxtrace.org" {
if domain == "api.nxtrace.org" {
ips, err = net.LookupIP("api.nxtrace.org")
} else {
ips, err = net.LookupIP(domain)
@@ -122,6 +122,7 @@ func checkLatency(domain string, ip string, port string) {
return
}
req.Host = domain
req.Header.Add("User-Agent", UserAgent)
resp, err := client.Do(req)
if err != nil {
//results <- ResponseInfo{IP: ip, Latency: "error", Content: ""}

View File

@@ -208,7 +208,7 @@ func GetenvDefault(key, defVal string) string {
}
func GetHostAndPort() (host string, port string) {
var hostP = GetenvDefault("NEXTTRACE_HOSTPORT", "origin-fallback.nxtrace.org")
var hostP = GetenvDefault("NEXTTRACE_HOSTPORT", "api.nxtrace.org")
// 解析域名
hostArr := strings.Split(hostP, ":")
// 判断是否有指定端口