connectrpc
A Tower-based Rust runtime implementing the Connect protocol, serving Connect, gRPC, and gRPC-Web clients over HTTP.
Repository Health
Technical Analysis
connectrpc is a Tower-based Rust implementation of the ConnectRPC protocol. A single server built with it simultaneously serves Connect, gRPC, and gRPC-Web clients over HTTP, exchanging binary or JSON protobuf messages, so you do not have to choose a single wire protocol up front.
Because the runtime is built on tower::Service, it is framework-agnostic and drops into any Tower-compatible HTTP stack such as Axum or Hyper. Alongside the core runtime, the project ships a protoc plugin and build-script integration for generating service traits and clients, plus standard health-check and server-reflection services. It passes the full ConnectRPC conformance suite across all three protocols.
What You Get
- A Tower-based runtime that serves Connect, gRPC, and gRPC-Web from a single server
- A
protoc-gen-connect-rustplugin that generates service traits, clients, and message types connectrpc-buildfor generating code at build time via build.rs- Standard
grpc.health.v1.Healthand gRPC server-reflection services - Support for unary and streaming RPCs, tower middleware, TLS, and JSON or binary protobuf
Common Use Cases
- Building Rust backend services callable from browsers, mobile apps, and other services alike
- Exposing gRPC APIs that also need to be reachable from gRPC-Web browser clients
- Adding health probes and reflection so grpcurl, buf curl, and service meshes can discover services
- Integrating RPC handlers into an existing Axum or Hyper application via Tower
Under The Hood
Architecture - The connectrpc crate (in connectrpc/src/) is organized around a Tower service pipeline: router.rs dispatches incoming requests, handler.rs and dispatcher.rs drive unary and streaming RPC handling, protocol.rs, codec.rs, and envelope.rs implement the Connect/gRPC/gRPC-Web wire formats and message framing, and server.rs/service.rs expose everything as tower::Service implementations. Cross-cutting concerns live in dedicated modules — compression.rs, deadline.rs, interceptor.rs, error.rs, and grpc_status.rs — and axum.rs provides first-class Axum integration. The workspace splits code generation (connectrpc-codegen, connectrpc-build) and optional services (connectrpc-health, connectrpc-reflection) into separate crates.
Tech Stack - Written in Rust (MSRV 1.88), the runtime builds on tower, http/http-body, bytes, tokio, futures, and pin-project, with protobuf handling delegated to the buffa message library. The project is a Cargo workspace with shared dependency and lint configuration, a conformance harness, benchmarks, and CI on GitHub Actions.
Code Quality - Quality is high for a pre-1.0 project: it passes the official ConnectRPC conformance suite (3,600 server and 6,872 client tests across three protocols), maintains a dedicated conformance/ crate and streaming integration tests, and declares and verifies its MSRV in CI. Code is modular with clear separation between protocol, transport, and service concerns.
API Design - The developer experience centers on generated, strongly typed service traits and clients, so most application code is ordinary async Rust rather than protocol plumbing. A long-form user guide and a set of runnable examples (streaming, middleware, TLS, wasm/browser, Bazel) cover the common paths, though the pre-1.0 status means the API surface may still shift within 0.x releases.