cloudflare / cloudflare/workerd

Support HTTP/2 bidirectional streaming (gRPC) in Workers/Durable Objects

Open
#6,455 12 comments 7 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

## Problem

Workers and Durable Objects cannot make outbound gRPC calls because the runtime doesn't support HTTP/2 bidirectional streaming. This forces developers to use REST/GraphQL fallbacks for services that offer gRPC as their primary (and often fastest) transport.

## Use Case

We're building on the [Sui blockchain](https://sui.io), which offers three RPC transports:
- **gRPC** (fastest, full-featured) — works in browsers via `@mysten/sui/grpc`
- **GraphQL** (read-only, no tx submission)
- **JSON-RPC** (legacy, being sunset April 2026)

In the browser, we race gRPC and GraphQL for optimal latency. But in Workers/DOs, we're stuck with GraphQL + JSON-RPC because gRPC requires HTTP/2 streaming.

This isn't just a Sui problem — gRPC is the standard transport for most blockchain full nodes (Ethereum, Solana, Cosmos, etc.), cloud services (GCP, AWS), and infrastructure tooling. Workers being unable to speak gRPC is a significant limitation for any Web3 or infrastructure project.

## Desired Behavior

`fetch()` in Workers/DOs should support HTTP/2 when connecting to upstream servers that advertise it, enabling:
- Unary gRPC calls (single request/response over HTTP/2)
- Server streaming (at minimum)
- Ideally full bidirectional streaming

Even supporting just **unary gRPC** (which is a single HTTP/2 POST with protobuf body + trailers) would unlock the vast majority of use cases.

## Current Workaround

Fall back to REST/GraphQL/JSON-RPC, which means:
- Higher latency (no connection multiplexing)
- Missing features (GraphQL is read-only for some services)
- Maintaining multiple transport paths in code
- Relying on legacy APIs that are being sunset

## References

- [gRPC over HTTP/2 spec](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md)
- [grpc-web](https://github.com/grpc/grpc-web) exists but requires a proxy, defeating the purpose of edge compute
- Deno Deploy and Bun both support HTTP/2 outbound

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.