mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-07-29 13:56:15 +02:00
Add prometheus and disable http2
This commit is contained in:
parent
1f191a5e41
commit
33a5e0e03c
3 changed files with 43 additions and 5 deletions
11
main.go
11
main.go
|
@ -3,6 +3,8 @@ package main
|
|||
import (
|
||||
"crypto/tls"
|
||||
"flag"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -42,9 +44,16 @@ func main() {
|
|||
server := http.Server{
|
||||
Addr: ":" + strconv.Itoa(*port),
|
||||
TLSConfig: cfg,
|
||||
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)), // disable http2
|
||||
}
|
||||
|
||||
http.HandleFunc("/remoteDesktopGateway/", handleGatewayProtocol)
|
||||
|
||||
http.Handle("/metrics", promhttp.Handler())
|
||||
|
||||
prometheus.MustRegister(connectionCache)
|
||||
prometheus.MustRegister(legacyConnections)
|
||||
prometheus.MustRegister(websocketConnections)
|
||||
|
||||
err = server.ListenAndServeTLS("", "")
|
||||
if err != nil {
|
||||
log.Fatal("ListenAndServe: ", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue