mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-07-30 06:16:18 +02:00
Refactor config and improve security
This commit is contained in:
parent
76e30ffa98
commit
c68ec69b92
3 changed files with 17 additions and 9 deletions
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue