mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
SNI和DNS不再分离,统一使用api.nxtrace.org
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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: ""}
|
||||
|
||||
@@ -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, ":")
|
||||
// 判断是否有指定端口
|
||||
|
||||
Reference in New Issue
Block a user