Accept cleartext HTTP/2 so Cloud Run can use end-to-end h2

This commit is contained in:
Ian Gulliver
2026-08-20 09:29:59 -07:00
parent 15da5ea291
commit 52668a6a09
+5 -1
View File
@@ -136,6 +136,10 @@ func main() {
if port == "" {
port = "8080"
}
protocols := new(http.Protocols)
protocols.SetHTTP1(true)
protocols.SetUnencryptedHTTP2(true)
server := &http.Server{Addr: ":" + port, Handler: cacheControl(handler), Protocols: protocols}
log.Printf("listening on http://localhost:%s", port)
log.Fatal(http.ListenAndServe(":"+port, cacheControl(handler)))
log.Fatal(server.ListenAndServe())
}