HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
grpc
grpc-web
JavaScript2016–2024
grpc / grpc-web

grpc-web

gRPC for Web Clients

23Distinct people
24Mentions
0Explicit recommenders
9.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

gRPC for Web Clients

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year24 dated mentions

Observed mentions: 2016-12-16 09:05:04 UTC to 2024-09-03 18:09:27 UTC.

02468102016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC110
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC918
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC202
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC303
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC312
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
gRPC Web · A JavaScript implementation of gRPC for browser clients. For more information, including a quick start, see the gRPC-web documentation. gRPC-web clients connect to gRPC services via a special proxy; by default, gRPC-web uses Envoy. In the future, we expect gRPC-web to be supported in language-specific web frameworks for languages such as Python, Java, and Node. For details, see the roadmap. Streaming Support gRPC-web currently supports 2 RPC modes: Unary RPCs (example) Server-side Streaming RPCs (example) (NOTE: Only when grpcwebtext mode is used.) Client-side and Bi-directional streaming is not currently supported (see streaming roadmap). Quick Start Eager to get started? Try the Hello World example. From this example, you'll learn how to do the following: Define your service using protocol buffers Implement a simple gRPC Service using Node.js Configure the Envoy proxy Generate protobuf message classes and client service stub for the client Compile all the JS dependencies into a static library that can be consumed by the browser easily Advanced Demo: Browser Echo App You can also try to run a more advanced Echo app from the browser with a streaming example. From the repo root directory: $ docker-compose pull prereqs node-server envoy commonjs-client $ docker-compose up node-server envoy commonjs-client Open a browser tab, and visit http://localhost:8081/echotest.html. To shutdown: docker-compose down. Runtime Library The gRPC-web runtime library is available on npm: $ npm i grpc-web Code Generator Plugins (Prerequisite) 1. Protobuf (protoc) If you don't already have protoc installed, download it first from here and install it on your PATH. If you use Homebrew (on macOS), you could run: brew install protobuf (Prerequisite) 2. Protobuf-javascript (protoc-gen-js) If you don't have protoc-gen-js installed, download it from protocolbuffers/protobuf-javascript and install it on your PATH. Or, use the third-party npm installer: npm install -g protoc-gen-js 3. Install gRPC-Web Code Generator You can download the protoc-gen-grpc-web protoc plugin from our release page: Make sure all executables are discoverable from your PATH. For example, on macOS, you can do: sudo mv protoc-gen-grpc-web-2.0.2-darwin-aarch64 \ /usr/local/bin/protoc-gen-grpc-web chmod +x /usr/local/bin/protoc-gen-grpc-web Note: If you are using our Docker setup, the prereqs image already includes both protoc and the protoc-gen-grpc-web plugin on the PATH. (Optional) 4. Verify Installations You can optionally verify the plugins work by following our Hello World example: cd net/grpc/gateway/examples/helloworld protoc -I=. helloworld.proto \ --js_out=import_style=commonjs:. \ --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. After the command runs successfully, you should now see two new files generated in the current directory. By running: ls -1 *_pb.js Installation is successful if you see the following 2 files: helloworld_pb.js — Generated by protoc-gen-js plugin helloworld_grpc_web_pb.js - Generated by gRPC-Web plugin Client Configuration Options Typically, you will run the following command to generate the proto messages and the service client stub from your .proto definitions: protoc -I=$DIR echo.proto \ --js_out=import_style=commonjs:$OUT_DIR \ --grpc-web_out=import_style=commonjs,mode=grpcwebtext:$OUT_DIR You can then use Browserify, Webpack, Closure Compiler, etc. to resolve imports at compile time. Import Style import_style=closure: The default generated code has Closure goog.require() import style. import_style=commonjs: The CommonJS style require() is also supported. import_style=commonjs+dts: In addition to above, a .d.ts typings file will also be generated for the protobuf messages and service stub import_style=typescript: The service stub will be generated in TypeScript. See TypeScript Support below for information on how to generate TypeScript files. Note: The commonjs+dts and typescript styles are only supported by --grpc-web_out=import_style=..., not by --js_out=import_style=.... Wire Format Mode For more information about the gRPC-web wire format, see the specification. mode=grpcwebtext: The default generated code sends the payloads in the grpc-web-text format. Content-Type: application/grpc-web-text Payloads are base64-encoded. Both unary and server streaming calls are supported. mode=grpcweb: A binary protobuf format is also supported. Content-Type: application/grpc-web+proto Payloads are in the binary protobuf format. Only unary calls are supported. How It Works Let's take a look at how gRPC-web works with a simple example. You can find out how to build, run and explore the example yourself in Build and Run the Echo Example. 1. Define your service The first step when creating any gRPC service is to define it. Like all gRPC services, gRPC-web uses protocol buffers to define its RPC service methods and their message request and response types. message EchoRequest { string message = 1; } ... service EchoService { rpc Echo(EchoRequest) returns (EchoResponse); rpc ServerStreamingEcho(ServerStreamingEchoRequest) returns (stream ServerStreamingEchoResponse); } 2. Run the server and proxy Next you need to have a gRPC server that implements the service interface and a gateway proxy that allows the client to connect to the server. Our example builds a simple Node gRPC backend server and the Envoy proxy. For the Echo service: see the service implementation. For the Envoy proxy: see the config YAML file. 3. Write your JS client Once the server and gateway are up and running, you can start making gRPC calls from the browser! Create your client: var echoService = new proto.mypackage.EchoServiceClient( 'http://localhost:8080'); Make a unary RPC call: var request = new proto.mypackage.EchoRequest(); request.setMessage(msg); var metadata = {'custom-header-1': 'value1'}; echoService.echo(request, metadata, function(err, response) { if (err) { console.log(err.c
Read the full README on GitHub

What Hacker News says

24 sources
It drives me bonkers that HTTP packs so many awesome capabilities that enable so much awesome gRPC stuff. Then web browsers never implement any of those capabilities. gRPC-web's roadmap is still a huge pile of workarounds they intend to build. These shouldn't be necessary! https://github.com/grpc/grpc-web/blob/master/doc/roadmap.md Instead of giving us http-push, everyone said, oh, we haven't figured out how to use it for content delivery well. And we've never ever let anyone else use it for anything. So to got canned. Http-trailers also seems to not have support, afaik. Why the web pours so much into HTML, js, CSS, but utterly neglects http, to the degree where grpc-web will probably end up tunneling http-over-webtransport is so cursed.
In gRPC: 5 Years Later, Is It Still Worth It?
FZambia·Aug 15, 2023Submission

Ask HN: WebSocket server transforming channel subscriptions to gRPC streams

Hello! I'd like to ask your opinion about the idea of a WebSocket server which can handle WebSocket connections, can manage channel subscriptions and transform them to GRPC streams to a custom backend server. Let's say we have a system with 3 participants like this: Client (browser, mobile device, etc.) —> WebSocket server (the subject to implement here) —> Backend server (any custom server in any language with good GRPC support). Then the mechanics is as follows: * Client establishes WebSocket connection with WebSocket server * Client can optionally subscribe to channels. Subscriptions to channels are multiplexed over a single WebSocket connection. * Upon receiving WebSocket connection (or subscription to channel) server can open unidirectional or bidirectional stream with the configured backend which implements GRPC service. * Backend m
Read the rest
ay stream data to connections or to channel subscriptions over established GRPC streams. Data from GRPC streams will be transformed to WebSocket messages and delivered to clients with minimal latency. * Additionally, client can stream data to the backend server (if bidirectional GRPC streams are used). I.e. client sends WebSocket messages, those will be transformed to GRPC messages by WebSocket server and delivered to the application backend. As a result we have a system which allows to quickly create individual streams by using strict GRPC contract but terminating connections over WebSocket transport. So it works well in web browsers. After that no need to write WebSocket protocol, client implementation, handle WebSocket connection. This all will be solved by a suggested WebSocket server and its client SDKs. The mechanics is similar to Websocketd (https://github.com/joewalnes/websocketd), but instead of creating OS processes we create GRPC streams. The difference from grpc-web (https://github.com/grpc/grpc-web) is that we provide streaming capabilities but not exposing GRPC contract to the client - just allowing to stream any data as payload (both binary and text) with some wrappers from our client SDKs side for managing subscriptions. I.e. it's not native GRPC streams on the client side - we expose just Connection/Subscription object to stream in both directions. GRPC streams used only for communication between WebSocket server and backend. To mention - grpc-web does not support all kinds of streaming now (https://github.com/grpc/grpc-web#streaming-support) while proposed solution can. This all should provide a cross-platform way to quickly write streaming apps due to client SDKs and language-agnostic nature of GRPC. I personally see both pros and cons in this scheme (without concentrating on both too much here to keep the question short). I spent some time thinking about this myself, already have some working prototypes – but turned out need more opinions before moving forward with the idea and releasing this, kinda lost in doubts. My main question - whether this seems interesting for someone here? Do you find this useful and see practical value?
1 points · Open discussion
> I mitigate it by configuring the serializer to be tolerant of new or missing keys, enum values, et Good point, we do that too. > We actually considered grpc at some point but decided against it as being a bit too limiting and mobile centric at the time. Also, grpc in a browser was not well supported at the time we looked. Maybe that has changed? Its supported: https://github.com/grpc/grpc-web Transcoding to HTTP is also supported: https://cloud.google.com/endpoints/docs/grpc/transcoding https://cloud.google.com/blog/products/api-management/unders...
In Kotlin Data Classes 101: Understanding Syntax, Usage and Inheritance
Personally, I find gRPC-Web very attractive but the current state of TypeScript/JS code-gen is very confusing and lacking. I would love something like https://orval.dev for gRPC-web. Have I missed something or is it just early to expect it? I tried a few libraries but couldn't get them to work or would generate unappealing results. I believe I'm hitting this issue with my local experiments. https://github.com/grpc/grpc-web/issues/535 UPDATE: I was able to get something working with these from a ReactJS app! Server: https://learn.microsoft.com/en-us/aspnet/core/grpc/grpcweb Client TS Gen: https://github.com/timostamm/protobuf-ts
In Ask HN: Why isn't JSON-RPC more widely adopted?
I adore gRPC but figuring out how to use it from browser JavaScript is painful. The official grpc-web [1] client requires envoy on the server which I don't want. The improbable-eng grpc-web [2] implementation has a native Go proxy you can integrate into a server, but seems riddled with caveats and feels a bit immature overall. Does grpc-web work well? Is there a way to skip the proxy layer and use protobufs directly if you use websockets? [1]: https://github.com/grpc/grpc-web [2]: https://github.com/grpc/grpc-web
In REST vs GraphQL vs gRPC
Our technology stack is very gRPC friendly, so developer experience is actually better with it, than without (though this is very subjective.) As for the middleboxes, using gRPC-WEB[1] allowed us to switch Desktop Client App to gRPC even behind firewalls/IDSes that do not speak HTTP/2 yet. As for the HAProxy, Dropbox used to use (circa 2013) it specifically for loadbalancing, but we eventually replaced it with our Golang proxy. That said, recent HAProxy improvements (v2.0+) make it quite an awesome dataplane and an excellent loadbalancer! [1] https://github.com/grpc/grpc-web
In Migrating Dropbox from Nginx to Envoy

Showing the 15 most recent of 24 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.