weaver icon indicating copy to clipboard operation
weaver copied to clipboard

Run alongside gRPC (will not HTTP2)

Open Galaf opened this issue 8 months ago • 0 comments

Hello!

Most examples use Chi or similar for the frontend part that exposes the endpoints to the real world but I'd like to use gRPC (most specifically connect-go).

That is, especially because I want to be able to use bidi streams from the client to the main component.

But it seems that something in weaver.Listener is preventing me to upgrade connections to HTT2 (h2c) and I can't seem to be able to figure it out.

So far, I tried the following:

  • Using h2c.NewHandler(handler, &http2.Server{}
  • Using http2.ConfigureServer(server, h2s)
  • Configuring TLSConfig.NextProtos to accept h2

To no avail.

The only thing that worked so far was to create my HTTP server and call http.ListenAndServe and it did work and gRPC was working correctly but due to the fact that it is creating two replicas, it will end up failing because it can't bind the same port twice.

My question is specifically for gRPC but I'm assuming that anybody trying to use HTTP2 in any shape or form will encounter the same issue.

Do you happen to know what would be the best way to make it work?

Thank you very much for your time!

Galaf avatar May 31 '24 11:05 Galaf