Use standard HandleFunc pattern

This commit is contained in:
Bolke de Bruin 2020-07-13 15:38:25 +02:00
parent 3ab375314a
commit 1f191a5e41
2 changed files with 20 additions and 26 deletions

View file

@ -41,10 +41,10 @@ func main() {
cfg.Certificates = append(cfg.Certificates, cert)
server := http.Server{
Addr: ":" + strconv.Itoa(*port),
Handler: Upgrade(nil),
TLSConfig: cfg,
}
http.HandleFunc("/remoteDesktopGateway/", handleGatewayProtocol)
err = server.ListenAndServeTLS("", "")
if err != nil {
log.Fatal("ListenAndServe: ", err)