mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2026-03-27 22:46:37 +00:00
Refactor config and improve security
This commit is contained in:
7
rdg.go
7
rdg.go
@@ -225,7 +225,12 @@ func handleWebsocketProtocol(conn *websocket.Conn) {
|
||||
log.Printf("Invalid PAA cookie: %s from %s", cookie, conn.RemoteAddr())
|
||||
return
|
||||
}
|
||||
host = strings.Replace(conf.Server.HostTemplate, "%%", data.(string), 1)
|
||||
host = conf.Server.HostTemplate
|
||||
for k, v := range data.(map[string]interface{}) {
|
||||
if val, ok := v.(string); ok == true {
|
||||
host = strings.Replace(host, "{{ " + k + " }}", val, 1)
|
||||
}
|
||||
}
|
||||
msg := createTunnelResponse()
|
||||
log.Printf("Create tunnel response: %x", msg)
|
||||
conn.WriteMessage(mt, msg)
|
||||
|
||||
Reference in New Issue
Block a user