mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-15 21:33:45 +02:00
Do round robin selection
This commit is contained in:
parent
55df8df3bc
commit
7264e7b92f
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,9 @@ func handleRdpDownload(w http.ResponseWriter, r *http.Request) {
|
|||
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{}) {
|
||||
if val, ok := v.(string); ok == true {
|
||||
host = strings.Replace(host, "{{ " + k + " }}", val, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue