add: http support http 2.0 server

This commit is contained in:
2024-01-26 16:44:52 +08:00
parent 88c303ff62
commit 22cd71ca21

View File

@@ -23,6 +23,7 @@ import (
"ems.agt/src/framework/middleware"
libSession "ems.agt/src/lib_features/session"
"github.com/gin-gonic/gin"
"golang.org/x/net/http2"
)
// const defaultConfigFile = "./etc/restconf.yaml"
@@ -108,6 +109,9 @@ func HttpListenConfigTLS(addr, caFile, certFile, keyFile string, clientAuthType
TLSConfig: tlsConfig,
}
// support http 2.0 server
http2.ConfigureServer(server, &http2.Server{})
err = server.ListenAndServeTLS(certFile, keyFile)
if err != nil {
fmt.Println("ListenAndServeTLS err:", err)