Introduction
Connect is a family of libraries for building browser and gRPC-compatible HTTP APIs: you write a short Protocol Buffer schema and implement your application logic, and Connect generates code to handle marshaling, routing, compression, and content type negotiation. It also generates an idiomatic, type-safe client in any supported language.
Production-grade simplicity
Each Connect implementation is focused: just the essential features, built on top of time-tested HTTP libraries and designed to get out of your way. In Go, Connect is just one package — short enough to read in an afternoon.
Connect is our vision of production-grade RPC. It's simple, reliable, and
unobtrusive, because nobody has time to debug overcomplicated networking or
sift through a hundred esoteric options. Under the hood, it's just Protocol
Buffers and net/http
, fetch
, URLSession
, or your language's gold standard
for HTTP.
Most of all, Connect is stable. We take backward compatibility very seriously, and we'll never break your build after tagging a stable release.
Seamless multi-protocol support
Connect servers and clients support three protocols: gRPC, gRPC-Web, and Connect's own protocol.
Connect fully supports the gRPC protocol, including streaming, trailers, and error details. Any gRPC client, in any language, can call a Connect server, and Connect clients can call any gRPC server. We validate our gRPC compatibility with an extended version of Google's own interoperability tests.
Connect also offers direct support for the gRPC-Web protocol used by grpc/grpc-web, without relying on a translating proxy like Envoy.
Finally, Connect supports its own protocol: a straightforward HTTP-based protocol that works over HTTP/1.1, HTTP/2, and HTTP/3. It takes the best parts of gRPC and gRPC-Web, including streaming, and packages them into a protocol that's equally at home in browsers, monoliths, and microservices. By default, implementations support both JSON- and binary-encoded Protobuf. You can call our live demo service with cURL:
curl \
--header "Content-Type: application/json" \
--data '{"sentence": "I feel happy."}' \
https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say
By default, Connect servers support ingress from all three protocols. Clients default to using the Connect protocol, but can switch to gRPC or gRPC-Web with a configuration toggle — no further code changes required. The APIs for errors, headers, trailers, and streaming are all protocol-agnostic.
Go
Connect's Go implementation is stable and used by several companies (including
Buf) in production. You can get started with connect-go
now.
TypeScript and JavaScript
Connect for ECMAScript is currently pre-v1, but it's in production at Buf and several other companies. We plan to release a stable v1 in late 2023. However, you can get started now on the web or in Node.js.
Swift and Kotlin
For mobile applications, connect-swift
and
connect-kotlin
are now available in beta. Get started today
with our Swift guide and Kotlin
guide.
What's next?
In addition to improving our current Connect implementations, we'd eventually like to bring Connect to more languages and frameworks. Our current roadmap is always pinned to the top of our GitHub discussions, and we gauge interest in new languages with GitHub polls.