Hasty Briefsbeta

Bilingual

Using HTTP/2 Cleartext for a server in Go 1.24

5 days ago
  • #Cloud Run
  • #Go Programming
  • #HTTP/2
  • SSE streams have long timeouts, but Google Cloud Run doesn't propagate client disconnects with HTTP/1.1, prompting a switch to HTTP/2.
  • Cloud Run supports HTTP/2 cleartext (h2c) via 'HTTP/2 with Prior Knowledge', terminating TLS at the frontend.
  • Go 1.24 simplifies h2c setup by allowing direct configuration on http.Server without external packages, unlike older versions.
  • Local testing with curl --http2-prior-knowledge verifies h2c functionality before deployment.
  • Terraform configuration for Cloud Run includes setting container ports, concurrency, and timeouts to support long-lived SSE connections.