Improve configurability

This commit is contained in:
Bolke de Bruin 2020-07-21 10:16:31 +02:00
parent 93b31ec9b6
commit 01345b9416
4 changed files with 97 additions and 53 deletions

13
main.go
View file

@ -89,7 +89,18 @@ func main() {
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)), // disable http2
}
http.HandleFunc("/remoteDesktopGateway/", protocol.HandleGatewayProtocol)
// create the gateway
handlerConfig := protocol.HandlerConf{
TokenAuth: true,
RedirectFlags: protocol.RedirectFlags{
Clipboard: true,
},
}
gw := protocol.Gateway{
HandlerConf: &handlerConfig,
}
http.HandleFunc("/remoteDesktopGateway/", gw.HandleGatewayProtocol)
http.HandleFunc("/connect", handleRdpDownload)
http.Handle("/metrics", promhttp.Handler())
http.HandleFunc("/callback", handleCallback)