From 52668a6a09c44e99b9625f40dbffdf824288a9ca Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 20 Aug 2026 09:29:59 -0700 Subject: [PATCH] Accept cleartext HTTP/2 so Cloud Run can use end-to-end h2 --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 353df7f..6416408 100644 --- a/main.go +++ b/main.go @@ -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()) }