How to match the environment of Google Cloud Run?

I really want to try deploying my app to fly but have been unable to get it to work. It’s currently running on Google Cloud Run due to them allowing end-to-end http2. My server is written in golang and uses the new connect-go grpc library (https://connect.build). Per their docs, I need to to use the HTTP/2 protocol without TLS (h2c). This was very simple in Google Cloud Run as I just needed to check a check box.

How can I configure the fly.toml file to work given these requirements? I have been experimenting with different settings and have had zero luck.

Hi @keithk

If you remove the http handler and only have the tls handler from your fly.toml then you should get the desired result. Note that you may still get http1.1 requests coming in as the fly proxy will simply be forwarding after tls and not handling anything at the http level.

1 Like

Thanks for the reply! I got it working with your advice. For anyone that comes across this thread, here is the final fly.toml that got it working for me:

// fly.toml

[[services]]
  internal_port = 8080
  protocol = "tcp"

  [[services.ports]]
    handlers = ["tls"]
    port = 443

  [services.ports.tls_options]
    alpn = ["h2"]

2 Likes

Nice! That works for grpc with connect.build?

Yup, really happy to get it working! Now to experiment with adding managed Redis :slight_smile:

1 Like