Add viper & download rdp file

This commit is contained in:
Bolke de Bruin
2020-07-16 16:04:04 +02:00
parent 31f09af9d0
commit 3797e279c2
4 changed files with 77 additions and 9 deletions

6
rdg.go
View File

@@ -217,7 +217,11 @@ func handleWebsocketProtocol(conn *websocket.Conn) {
log.Printf("Handshake response: %x", msg)
conn.WriteMessage(mt, msg)
case PKT_TYPE_TUNNEL_CREATE:
readCreateTunnelRequest(pkt)
_, cookie := readCreateTunnelRequest(pkt)
if _, found := tokens.Get(cookie); found == false {
log.Printf("Invalid PAA cookie: %s from %s", cookie, conn.RemoteAddr())
return
}
msg := createTunnelResponse()
log.Printf("Create tunnel response: %x", msg)
conn.WriteMessage(mt, msg)