mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-29 15:06:36 +00:00
Do round robin selection
This commit is contained in:
@@ -28,7 +28,9 @@ func handleRdpDownload(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var host = conf.Server.HostTemplate
|
// do a round robin selection for now
|
||||||
|
rand.Seed(time.Now().Unix())
|
||||||
|
var host = conf.Server.Hosts[rand.Intn(len(conf.Server.Hosts))]
|
||||||
for k, v := range data.(map[string]interface{}) {
|
for k, v := range data.(map[string]interface{}) {
|
||||||
if val, ok := v.(string); ok == true {
|
if val, ok := v.(string); ok == true {
|
||||||
host = strings.Replace(host, "{{ " + k + " }}", val, 1)
|
host = strings.Replace(host, "{{ " + k + " }}", val, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user