HACKER Q&A
📣 wg0

It is 2023. What's stopping gRPC in browsers?


What is the status of gRPC in browser as of 2023? The documentation here[1] from 2019 states that there are two implementations but none works out of the box without a proxy in between the gRPC service and the client. It also mentions about Streams Specification[2] to be available in the browsers. On the page itself, many of the demos seem to work fine even on Safari. As of caniuse.com, it seems that the spec has apparently good support [3].

So what gives? What is holding back the possibility of direct gRPC calls from browsers without a proxy in between?

[1] https://grpc.io/blog/state-of-grpc-web/

[2] https://streams.spec.whatwg.org/

[3] https://caniuse.com/streams

EDIT: Typos


  👤 cratermoon Accepted Answer ✓
The first article you link says:

> It is currently impossible to implement the HTTP/2 gRPC spec in the browser, as there is simply no browser API with enough fine-grained control over the requests. For example: there is no way to force the use of HTTP/2, and even if there was, raw HTTP/2 frames are inaccessible in browsers.

I read that to mean getting direct gRPC support in browsers is a significant effort. A large enough effort that there's currently no justification for diverting time and people from higher priority work.


👤 mobilio
Why we need gRPC in browsers?

Honestly there is WebSockets - where you can send/receive almost anything.