From 74f46f5d244da246d97ec31793cec1cf4ecf80cf Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Wed, 28 Jun 2023 23:40:54 +0800 Subject: [PATCH] fix bugs:proxy settings https://github.com/nxtrace/Ntrace-V1/pull/2#issuecomment-1610979252 --- util/latency.go | 4 ++++ wshandle/client.go | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/latency.go b/util/latency.go index 21fd0611..4ac384dc 100644 --- a/util/latency.go +++ b/util/latency.go @@ -17,6 +17,10 @@ var ( var FastIpCache = "" func GetFastIP(domain string, port string, enableOutput bool) string { + proxyUrl := GetProxy() + if proxyUrl != nil { + return "api.leo.moe" + } if FastIpCache != "" { return FastIpCache } diff --git a/wshandle/client.go b/wshandle/client.go index c945bf2b..2802b45e 100644 --- a/wshandle/client.go +++ b/wshandle/client.go @@ -187,9 +187,6 @@ func createWsConn() *WsConn { } else { // 默认配置完成,开始寻找最优 IP fastIp = util.GetFastIP(host, port, true) - if proxyUrl != nil { - fastIp = "api.leo.moe" - } } jwtToken, ua := envToken, []string{"Privileged Client"} err := error(nil)