Getting GRPC working when server is behind LB or Proxy

358 views
Skip to first unread message

tz...@reblaze.com

unread,
Aug 31, 2017, 10:11:33 AM8/31/17
to grpc.io

What are common solutions getting gRPC app running when there is a requirement to run through a some sort of proxy which does not support HTTP/2 toward origin, rather towards client side.


Were you people got this kind of setup done somehow?


The setup via proxy would create a flow similar to this:


Client <--- HTTP/2 ---> Proxy <--- HTTP/1.1 ---> gRPC Server.


Evan Jones

unread,
Sep 1, 2017, 4:48:03 PM9/1/17
to grpc.io, tz...@reblaze.com
We sort of have this situation, since we use Google App Engine, and its load balancer and URLFetch service only support HTTP/1.1. We used the PRPC implementation described here, which is a mapping of the simple unary gRPC requests to an HTTP/1.1 protocol: http://nodir.io/post/138899670556/prpc. We used the Go implementation from the Chrome tools repository, and wrote our own client and server, which were relatively simple but absolutely do not support all of gRPC's features.

The "better" approach might be to look at the grpc-web work, and possibly just run the grpcwebproxy. See: https://github.com/improbable-eng/grpc-web

I think that will also have the problem that if your clients aren't Go or Javascript, you will need to implement the protocol yourself.

Good luck and hope this helps,

Evan

Evan Jones

unread,
Sep 1, 2017, 4:50:28 PM9/1/17
to grpc.io, tz...@reblaze.com
Oops I also forgot: Lyft Envoy includes an HTTP/1.1 gRPC bridge as well that might be useful: https://lyft.github.io/envoy/docs/configuration/http_filters/grpc_http1_bridge_filter.html

Eric Anderson

unread,
Sep 5, 2017, 8:15:34 PM9/5/17
to tz...@reblaze.com, grpc.io
We normally recommend using a proxy that supports HTTP/2 to the backend, like nghttpx and derivatives (Enjoy, Istio). If that's not possible, then the solutions tend to involve something that looks like grpc-web.

If the proxy you are already using supports HTTP/1.1 trailers, it should be possible to use nghttpx to up-convert back to HTTP/2, but I've not tried that out.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/997fd992-dd4e-40d9-bb72-c4f61d0eebbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tz...@reblaze.com

unread,
Sep 5, 2017, 8:35:41 PM9/5/17
to grpc.io, tz...@reblaze.com
Thank you all for advise and suggestions!


On Wednesday, September 6, 2017 at 3:15:34 AM UTC+3, Eric Anderson wrote:
We normally recommend using a proxy that supports HTTP/2 to the backend, like nghttpx and derivatives (Enjoy, Istio). If that's not possible, then the solutions tend to involve something that looks like grpc-web.

If the proxy you are already using supports HTTP/1.1 trailers, it should be possible to use nghttpx to up-convert back to HTTP/2, but I've not tried that out.
On Thu, Aug 31, 2017 at 7:11 AM, <tz...@reblaze.com> wrote:

What are common solutions getting gRPC app running when there is a requirement to run through a some sort of proxy which does not support HTTP/2 toward origin, rather towards client side.


Were you people got this kind of setup done somehow?


The setup via proxy would create a flow similar to this:


Client <--- HTTP/2 ---> Proxy <--- HTTP/1.1 ---> gRPC Server.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages