Friday, October 30, 2026

Introducing grpc-over-datachannels: gRPC over WebRTC DataChannels, without HTTP/2

Today we are launching grpc-over-datachannels: gRPC running over a single WebRTC RTCDataChannel instead of HTTP/2. Many concurrent calls — unary, server-streaming, client-streaming, and bidirectional streaming — are multiplexed onto one ordered, reliable data channel using a small frame protocol, with no HTTP/2 stack and no server endpoint to reach.

The runtimes are generated and dependency-free. From one source of truth, recursive metaprogramming generates the gRPC runtime and protoc plugins for Rust, JavaScript, Go, Python, Java, C#, C++, Swift, Kotlin, Dart, Zig, C99, Lua, Ruby, PHP, and Scala — for native clients and servers, and for browser clients (including WASM facades that wrap the JavaScript browser client). Generated tests verify the wire protocol against stock gRPC implementations through a TCP-to-DataChannel proxy, so behaviour is checked against the reference, not just against itself.

Try it in the browser

No install is needed to generate stubs for your own service. Open the live in-browser generator, paste or edit a .proto file, pick your languages, and download generated stubs plus the matching runtimes. Schema compilation and the actual code generators run entirely client-side in the page.

Get the code

Source, specification, quick start, and examples are on GitHub: browser-grpc/grpc-over-datachannels. Documentation lives at browser-grpc.github.io/grpc-over-datachannels. Current release: v0.36.0.

This blog is now the project log for grpc-over-datachannels. The older low-latency and systems posts below — on websockets, AF_XDP, kernel latency, and socket multiplexing — are the background this work grew out of, and they are staying. Next up: the Kafka proxy, and the package ecosystem.

Dig deeper

The wire format under all of this is specified in One data channel, many calls: the grpc-dc frame protocol. Underneath it sits our own WebRTC stack: Rebuilding WebRTC from scratch: ICE, DTLS, SCTP with zero dependencies. And the generated runtimes are graded against Google's implementations, not just themselves: Trust but verify: oracle-testing generated gRPC.

No comments:

Post a Comment