10

If the browser supports http/2, why does grpc-web require envoy proxy?

Is it just required for older browsers that do not support http/2?

Patryk
  • 22,602
  • 44
  • 128
  • 244
Deep Vora
  • 318
  • 3
  • 13

1 Answers1

8

Answered in https://github.com/grpc/grpc-web/issues/347. For gRPC-Web to work, we need a lot of the underlying transport to be exposed to us but that's not the case currently cross browsers. We cannot leverage the full http2 protocol given the current set of browser APIs.

Stanley Cheung
  • 347
  • 1
  • 3
  • 4
    Does it still need a proxy in 2020? This link(https://grpc.io/blog/grpc-web-ga/) has a statement `...a JavaScript client library that enables web apps to communicate directly with gRPC backend services, without requiring an HTTP server to act as an intermediary` This is a little confusing to me. – pinkpanther Dec 11 '20 at 06:20
  • 3
    @pinkpanther I was confused by that sentence too, but when I read further in the same article it says `The last piece of the puzzle is the service proxy. From the get-go, gRPC-Web will support Envoy as the default service proxy, which has a built-in envoy.grpc_web filter that you can apply with just a few lines of configuration.` so I think (???) first sentence is incorrect or at least misleading. Caveat : I am just a beginner in this subject. – k1eran Jan 07 '21 at 13:49