This commit is contained in:
aozhiwei 2024-08-30 16:39:06 +08:00
parent 278bb81dd8
commit ba1f3f83f0

View File

@ -7,6 +7,7 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"math/rand"
) )
type downStreamHost struct { type downStreamHost struct {
@ -189,6 +190,6 @@ func (this *sApiForward) GetDownStreamHost() (string, string) {
newUrl := mt.Table.Config.GetById(0).GetRedirectUrl() newUrl := mt.Table.Config.GetById(0).GetRedirectUrl()
return newUrl, "" return newUrl, ""
} }
downStream := downStreams[0] downStream := downStreams[rand.Intn(len(downStreams))]
return downStream.url, downStream.host return downStream.url, downStream.host
} }