Is there anybody that success implement h2c(HTTP/2 Plain text) Protocol in beego as a server?
I have tried to use http/2 from golang.org/x/net/http2 package using this approach https://beego.me/docs/mvc/controller/router.md#handler-register
I have implemented like this
h2server := &http2.Server{}
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = fmt.Fprintf(w, "Hello, %v, http: %v", r.URL.Path, r.TLS == nil)
})
server := &http.Server{
Addr: "0.0.0.0:" + strconv.Itoa(beego.BConfig.Listen.HTTPPort),
Handler: h2c.NewHandler(handler, h2server),
}
But all of my beego.router must move into the handler.
Is there any other better approach with that?
Thanks
FEF
question from:
https://stackoverflow.com/questions/65895268/how-to-implement-h2c-http-2-plain-text-on-beego-framework 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…