diff --git a/README.md b/README.md index 7217c2d7..e5cc0140 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ nexttrace 2606:4700:4700::1111 # Disable Path Visualization With the -M parameter nexttrace koreacentral.blob.core.windows.net -# MapTrace URL: https://api.leo.moe/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html +# MapTrace URL: https://api.nxtrace.org/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html # Disable MPLS display using the --disable-mpls / -e parameter or the NEXTTRACE_DISABLEMPLS environment variable nexttrace --disable-mpls example.com @@ -313,7 +313,7 @@ Usage: nexttrace [-h|--help] [-4|--ipv4] [-6|--ipv6] [-T|--tcp] [-U|--udp] ] [--parallel-requests ] [-m|--max-hops ] [-d|--data-provider (Ip2region|ip2region|IP.SB|ip.sb|IPInfo|ipinfo|IPInsight|ipinsight|IPAPI.com|ip-api.com|IPInfoLocal|ipinfolocal|chunzhen|LeoMoeAPI|leomoeapi|disable-geoip)] - [--pow-provider (api.leo.moe|sakura)] [-n|--no-rdns] + [--pow-provider (api.nxtrace.org|sakura)] [-n|--no-rdns] [-a|--always-rdns] [-P|--route-path] [-r|--report] [--dn42] [-o|--output] [-t|--table] [--raw] [-j|--json] [-c|--classic] [-f|--first ] [-M|--map] [-e|--disable-mpls] @@ -353,9 +353,9 @@ Arguments: IPInfo, IPInsight, IP-API.com, Ip2region, IPInfoLocal, CHUNZHEN, disable-geoip]. Default: LeoMoeAPI - --pow-provider Choose PoW Provider [api.leo.moe, sakura] + --pow-provider Choose PoW Provider [api.nxtrace.org, sakura] For China mainland users, please use - sakura. Default: api.leo.moe + sakura. Default: api.nxtrace.org -n --no-rdns Do not resolve IP addresses to their domain names -a --always-rdns Always resolve IP addresses to their diff --git a/README_zh_CN.md b/README_zh_CN.md index 9ebc93f1..a71890da 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -173,7 +173,7 @@ nexttrace 2606:4700:4700::1111 # 禁用路径可视化 使用 --map / -M 参数 nexttrace koreacentral.blob.core.windows.net -# MapTrace URL: https://api.leo.moe/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html +# MapTrace URL: https://api.nxtrace.org/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html # 禁用MPLS显示 使用 --disable-mpls / -e 参数 或 NEXTTRACE_DISABLEMPLS 环境变量 nexttrace --disable-mpls example.com @@ -312,7 +312,7 @@ Usage: nexttrace [-h|--help] [-4|--ipv4] [-6|--ipv6] [-T|--tcp] [-U|--udp] ] [--parallel-requests ] [-m|--max-hops ] [-d|--data-provider (Ip2region|ip2region|IP.SB|ip.sb|IPInfo|ipinfo|IPInsight|ipinsight|IPAPI.com|ip-api.com|IPInfoLocal|ipinfolocal|chunzhen|LeoMoeAPI|leomoeapi|disable-geoip)] - [--pow-provider (api.leo.moe|sakura)] [-n|--no-rdns] + [--pow-provider (api.nxtrace.org|sakura)] [-n|--no-rdns] [-a|--always-rdns] [-P|--route-path] [-r|--report] [--dn42] [-o|--output] [-t|--table] [--raw] [-j|--json] [-c|--classic] [-f|--first ] [-M|--map] [-e|--disable-mpls] @@ -352,9 +352,9 @@ Arguments: IPInfo, IPInsight, IP-API.com, Ip2region, IPInfoLocal, CHUNZHEN, disable-geoip]. Default: LeoMoeAPI - --pow-provider Choose PoW Provider [api.leo.moe, sakura] + --pow-provider Choose PoW Provider [api.nxtrace.org, sakura] For China mainland users, please use - sakura. Default: api.leo.moe + sakura. Default: api.nxtrace.org -n --no-rdns Do not resolve IP addresses to their domain names -a --always-rdns Always resolve IP addresses to their diff --git a/cmd/cmd.go b/cmd/cmd.go index 4c1ec874..731b0f25 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -42,8 +42,8 @@ func Excute() { maxHops := parser.Int("m", "max-hops", &argparse.Options{Default: 30, Help: "Set the max number of hops (max TTL to be reached)"}) dataOrigin := parser.Selector("d", "data-provider", []string{"Ip2region", "ip2region", "IP.SB", "ip.sb", "IPInfo", "ipinfo", "IPInsight", "ipinsight", "IPAPI.com", "ip-api.com", "IPInfoLocal", "ipinfolocal", "chunzhen", "LeoMoeAPI", "leomoeapi", "disable-geoip"}, &argparse.Options{Default: "LeoMoeAPI", Help: "Choose IP Geograph Data Provider [IP.SB, IPInfo, IPInsight, IP-API.com, Ip2region, IPInfoLocal, CHUNZHEN, disable-geoip]"}) - powProvider := parser.Selector("", "pow-provider", []string{"api.leo.moe", "sakura"}, &argparse.Options{Default: "api.leo.moe", - Help: "Choose PoW Provider [api.leo.moe, sakura] For China mainland users, please use sakura"}) + powProvider := parser.Selector("", "pow-provider", []string{"api.nxtrace.org", "sakura"}, &argparse.Options{Default: "api.nxtrace.org", + Help: "Choose PoW Provider [api.nxtrace.org, sakura] For China mainland users, please use sakura"}) noRdns := parser.Flag("n", "no-rdns", &argparse.Options{Help: "Do not resolve IP addresses to their domain names"}) alwaysRdns := parser.Flag("a", "always-rdns", &argparse.Options{Help: "Always resolve IP addresses to their domain names"}) routePath := parser.Flag("P", "route-path", &argparse.Options{Help: "Print traceroute hop path by ASN and location"}) @@ -173,7 +173,7 @@ func Excute() { // defer wg.Done() if strings.ToUpper(*dataOrigin) == "LEOMOEAPI" { val, ok := os.LookupEnv("NEXTTRACE_DATAPROVIDER") - if strings.ToUpper(*powProvider) != "API.LEO.MOE" { + if strings.ToUpper(*powProvider) != "API.NXTRACE.ORG" { util.PowProviderParam = *powProvider } if ok { diff --git a/fast_trace/basic.go b/fast_trace/basic.go index 5b880810..7801be09 100644 --- a/fast_trace/basic.go +++ b/fast_trace/basic.go @@ -49,36 +49,36 @@ var Beijing = BackBoneCollection{ Location: "北京", CT163: ISPCollection{ ISPName: CT163, - IP: "ipv4.pek-4134.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.pek-4134.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-4134.endpoint.nxtrace.org.", + IPv6: "ipv6.pek-4134.endpoint.nxtrace.org.", }, CU169: ISPCollection{ ISPName: CU169, - IP: "ipv4.pek-4837.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.pek-4837.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-4837.endpoint.nxtrace.org.", + IPv6: "ipv6.pek-4837.endpoint.nxtrace.org.", }, CU9929: ISPCollection{ ISPName: CU9929, - IP: "ipv4.pek-9929.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-9929.endpoint.nxtrace.org.", }, CM: ISPCollection{ ISPName: CM, - IP: "ipv4.pek-9808.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.pek-9808.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-9808.endpoint.nxtrace.org.", + IPv6: "ipv6.pek-9808.endpoint.nxtrace.org.", }, CMIN2: ISPCollection{ ISPName: CMIN2, - IP: "ipv4.pek-58807.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-58807.endpoint.nxtrace.org.", }, EDU: ISPCollection{ ISPName: EDU, - IP: "ipv4.pek-4538.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.pek-4538.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.pek-4538.endpoint.nxtrace.org.", + IPv6: "ipv6.pek-4538.endpoint.nxtrace.org.", }, } @@ -86,42 +86,42 @@ var Shanghai = BackBoneCollection{ Location: "上海", CT163: ISPCollection{ ISPName: CT163, - IP: "ipv4.sha-4134.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.sha-4134.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-4134.endpoint.nxtrace.org.", + IPv6: "ipv6.sha-4134.endpoint.nxtrace.org.", }, CTCN2: ISPCollection{ ISPName: CTCN2, - IP: "ipv4.sha-4809.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-4809.endpoint.nxtrace.org.", }, CU169: ISPCollection{ ISPName: CU169, - IP: "ipv4.sha-4837.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.sha-4837.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-4837.endpoint.nxtrace.org.", + IPv6: "ipv6.sha-4837.endpoint.nxtrace.org.", }, CU9929: ISPCollection{ ISPName: CU9929, - IP: "ipv4.sha-9929.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.sha-9929.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-9929.endpoint.nxtrace.org.", + IPv6: "ipv6.sha-9929.endpoint.nxtrace.org.", }, CM: ISPCollection{ ISPName: CM, - IP: "ipv4.sha-9808.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.sha-9808.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-9808.endpoint.nxtrace.org.", + IPv6: "ipv6.sha-9808.endpoint.nxtrace.org.", }, CMIN2: ISPCollection{ ISPName: CMIN2, - IP: "ipv4.sha-58807.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-58807.endpoint.nxtrace.org.", }, EDU: ISPCollection{ ISPName: EDU, - IP: "ipv4.sha-4538.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.sha-4538.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.sha-4538.endpoint.nxtrace.org.", + IPv6: "ipv6.sha-4538.endpoint.nxtrace.org.", }, } @@ -129,20 +129,20 @@ var Guangzhou = BackBoneCollection{ Location: "广州", CT163: ISPCollection{ ISPName: CT163, - IP: "ipv4.can-4134.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.can-4134.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.can-4134.endpoint.nxtrace.org.", + IPv6: "ipv6.can-4134.endpoint.nxtrace.org.", }, CU169: ISPCollection{ ISPName: CU169, - IP: "ipv4.can-4837.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.can-4837.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.can-4837.endpoint.nxtrace.org.", + IPv6: "ipv6.can-4837.endpoint.nxtrace.org.", }, CM: ISPCollection{ ISPName: CM, - IP: "ipv4.can-9808.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.can-9808.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.can-9808.endpoint.nxtrace.org.", + IPv6: "ipv6.can-9808.endpoint.nxtrace.org.", }, } @@ -150,23 +150,23 @@ var Hangzhou = BackBoneCollection{ Location: "杭州", CT163: ISPCollection{ ISPName: CT163, - IP: "ipv4.hgh-4134.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.hgh-4134.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hgh-4134.endpoint.nxtrace.org.", + IPv6: "ipv6.hgh-4134.endpoint.nxtrace.org.", }, CU169: ISPCollection{ ISPName: CU169, - IP: "ipv4.hgh-4837.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hgh-4837.endpoint.nxtrace.org.", }, CM: ISPCollection{ ISPName: CM, - IP: "ipv4.hgh-9808.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.hgh-9808.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hgh-9808.endpoint.nxtrace.org.", + IPv6: "ipv6.hgh-9808.endpoint.nxtrace.org.", }, // 浙江大学 教育网 EDU: ISPCollection{ ISPName: EDU, - IP: "ipv4.hgh-4538.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.hgh-4538.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hgh-4538.endpoint.nxtrace.org.", + IPv6: "ipv6.hgh-4538.endpoint.nxtrace.org.", }, } @@ -175,12 +175,12 @@ var Hefei = BackBoneCollection{ // 中国科学技术大学 教育网 EDU: ISPCollection{ ISPName: EDU, - IP: "ipv4.hfe-4538.nexttrace-io-fasttrace-endpoint.win.", - IPv6: "ipv6.hfe-4538.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hfe-4538.endpoint.nxtrace.org.", + IPv6: "ipv6.hfe-4538.endpoint.nxtrace.org.", }, // 中国科学技术大学 科技网 CST: ISPCollection{ ISPName: "中国科学技术大学 科技网 AS7497", - IP: "ipv4.hfe-7497.nexttrace-io-fasttrace-endpoint.win.", + IP: "ipv4.hfe-7497.endpoint.nxtrace.org.", }, } diff --git a/pow/pow_test.go b/pow/pow_test.go index 26c53709..87a80b10 100644 --- a/pow/pow_test.go +++ b/pow/pow_test.go @@ -10,7 +10,7 @@ import ( func TestGetToken(t *testing.T) { // 计时开始 start := time.Now() - token, err := GetToken("api.leo.moe", "api.leo.moe", "443") + token, err := GetToken("origin-fallback.nxtrace.org", "origin-fallback.nxtrace.org", "443") // 计时结束 end := time.Now() fmt.Println("耗时:", end.Sub(start)) diff --git a/tracemap/tracemap.go b/tracemap/tracemap.go index 8195fafe..16683269 100644 --- a/tracemap/tracemap.go +++ b/tracemap/tracemap.go @@ -16,14 +16,14 @@ import ( func GetMapUrl(r string) (string, error) { host, port := util.GetHostAndPort() - fastIp := "api.leo.moe" + fastIp := "origin-fallback.nxtrace.org" // 如果 host 是一个 IP 使用默认域名 if valid := net.ParseIP(host); valid != nil { fastIp = host if len(strings.Split(fastIp, ":")) > 1 { fastIp = "[" + fastIp + "]" } - host = "api.leo.moe" + host = "origin-fallback.nxtrace.org" } else { // 默认配置完成,开始寻找最优 IP fastIp = util.GetFastIP(host, port, false) diff --git a/util/dns_test.go b/util/dns_test.go index fb5d6a8c..1844a504 100644 --- a/util/dns_test.go +++ b/util/dns_test.go @@ -13,8 +13,8 @@ func TestDNS(t *testing.T) { } func TestDomainLookUp(t *testing.T) { - ips, _ := DomainLookUp("pek-4134.nexttrace-io-fasttrace-endpoint.win.", "all", "", false) + ips, _ := DomainLookUp("pek-4134.endpoint.nxtrace.org.", "all", "", false) fmt.Println(ips) - ips, _ = DomainLookUp("pek-4134.nexttrace-io-fasttrace-endpoint.win.", "4", "", false) + ips, _ = DomainLookUp("pek-4134.endpoint.nxtrace.org.", "4", "", false) fmt.Println(ips) } diff --git a/util/latency.go b/util/latency.go index 1f86af8c..7d69366b 100644 --- a/util/latency.go +++ b/util/latency.go @@ -28,13 +28,20 @@ var FastIpCache = "" func GetFastIP(domain string, port string, enableOutput bool) string { proxyUrl := GetProxy() if proxyUrl != nil { - return "api.leo.moe" + return "origin-fallback.nxtrace.org" } if FastIpCache != "" { return FastIpCache } - ips, err := net.LookupIP(domain) + var ips []net.IP + var err error + if domain == "origin-fallback.nxtrace.org" { + ips, err = net.LookupIP("api.nxtrace.org") + } else { + ips, err = net.LookupIP(domain) + } + if err != nil { log.Fatal("DNS resolution failed, please check your system DNS Settings") } diff --git a/util/latency_test.go b/util/latency_test.go index e7088f69..659f2861 100644 --- a/util/latency_test.go +++ b/util/latency_test.go @@ -2,5 +2,5 @@ package util //github action test 不支持v6 这里会报错 //func TestGetFastIP(t *testing.T) { -// GetFastIP("api.leo.moe", "443", true) +// GetFastIP("origin-fallback.nxtrace.org", "443", true) //} diff --git a/util/util.go b/util/util.go index 15a08398..d844b9f8 100644 --- a/util/util.go +++ b/util/util.go @@ -168,7 +168,7 @@ func GetenvDefault(key, defVal string) string { } func GetHostAndPort() (host string, port string) { - var hostP = GetenvDefault("NEXTTRACE_HOSTPORT", "api.leo.moe") + var hostP = GetenvDefault("NEXTTRACE_HOSTPORT", "origin-fallback.nxtrace.org") // 解析域名 hostArr := strings.Split(hostP, ":") // 判断是否有指定端口 @@ -210,7 +210,7 @@ func GetProxy() *url.URL { func GetPowProvider() string { var powProvider = "" if PowProviderParam == "" { - powProvider = GetenvDefault("NEXTTRACE_POWPROVIDER", "api.leo.moe") + powProvider = GetenvDefault("NEXTTRACE_POWPROVIDER", "api.nxtrace.org") } else { powProvider = PowProviderParam } diff --git a/wshandle/client.go b/wshandle/client.go index ad2d3e87..1813254e 100644 --- a/wshandle/client.go +++ b/wshandle/client.go @@ -192,7 +192,7 @@ func createWsConn() *WsConn { if len(strings.Split(fastIp, ":")) > 1 { fastIp = "[" + fastIp + "]" } - host = "api.leo.moe" + host = "origin-fallback.nxtrace.org" } else { // 默认配置完成,开始寻找最优 IP fastIp = util.GetFastIP(host, port, true)