From a44aaa1cba48d4add0da76bed78f70c08fc0c99d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 30 Aug 2024 17:39:35 +0800 Subject: [PATCH] 1 --- server/gamesapi/service/sapi_forward.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/gamesapi/service/sapi_forward.go b/server/gamesapi/service/sapi_forward.go index 3909f785..9cb15ea7 100644 --- a/server/gamesapi/service/sapi_forward.go +++ b/server/gamesapi/service/sapi_forward.go @@ -13,9 +13,9 @@ import ( ) type downStreamHost struct { - host string - port int32 - url string + Host string `json:"host"` + Port int32 `json:"port"` + Url string `json:"url"` } type sApiForward struct { @@ -205,9 +205,9 @@ func (this *sApiForward) LoadDownStreams() error { enable := q5.ToInt32(ds.GetByName("enable")) if enable != 0 { downSteam := *q5.NewSliceElement(&downStreams) - downSteam.host = host - downSteam.port = port - downSteam.url = fmt.Sprintf("http://%s:%d", downSteam.host, downSteam.port) + downSteam.Host = host + downSteam.Port = port + downSteam.Url = fmt.Sprintf("http://%s:%d", downSteam.Host, downSteam.Port) } } if len(downStreams) > 0 { @@ -226,5 +226,5 @@ func (this *sApiForward) GetDownStreamHost() (string, string) { return mt.Table.Config.GetRedirectUrl(), "" } downStream := downStreams[rand.Intn(len(downStreams))] - return downStream.url, mt.Table.Config.GetRedirectHost() + return downStream.Url, mt.Table.Config.GetRedirectHost() }