Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsMay 23, 2026·3 min de lectura

ConnectRPC — Simple Browser-Compatible RPC over HTTP

ConnectRPC is a slim RPC framework that generates type-safe clients and servers from Protobuf definitions, speaking gRPC, gRPC-Web, and its own HTTP-friendly Connect protocol through a single codebase.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
ConnectRPC Overview
Comando CLI universal
npx tokrepo install 2d7ac20c-5661-11f1-9bc6-00163e2b0d79

Introduction

ConnectRPC simplifies RPC by building on standard HTTP. It generates type-safe clients and handlers from Protobuf schemas, and each server simultaneously speaks three protocols—Connect (simple HTTP), gRPC, and gRPC-Web—so browsers, mobile apps, and backend services all hit the same endpoint.

What ConnectRPC Does

  • Generates type-safe client and server code from Protobuf service definitions
  • Serves the Connect, gRPC, and gRPC-Web protocols on a single port and handler
  • Works with net/http in Go, requiring no special HTTP server or mux
  • Supports unary, server-streaming, client-streaming, and bidirectional streaming RPCs
  • Provides interceptors for authentication, logging, and observability middleware

Architecture Overview

ConnectRPC generates handler and client code via protoc-gen-connect-go (Go), @connectrpc/connect (TypeScript), or plugins for other languages. Handlers register as standard HTTP handlers, detecting the protocol from each request's Content-Type header. The Connect protocol uses simple HTTP POST with JSON or Protobuf bodies—curl-friendly without special tooling. gRPC and gRPC-Web requests on the same endpoint are handled transparently.

Installation & Configuration

  • Install the Buf CLI and protoc-gen-connect-go for Go code generation
  • Use @connectrpc/connect and @connectrpc/connect-web for TypeScript clients
  • Register handlers on any http.ServeMux or router—no proprietary server needed
  • Configure TLS and HTTP/2 via standard Go net/http or your preferred reverse proxy
  • Add interceptors in the handler or client constructor for cross-cutting concerns

Key Features

  • Three protocols (Connect, gRPC, gRPC-Web) from a single handler implementation
  • Browser-native: the Connect protocol works with fetch() without a proxy
  • curl-friendly: curl -X POST --json works against Connect endpoints
  • Standard HTTP middleware compatibility (no gRPC-specific interceptor chains)
  • Streaming support across all three protocols including bidirectional

Comparison with Similar Tools

  • gRPC-Go — requires grpc.NewServer() and HTTP/2; ConnectRPC uses net/http and adds browser support
  • Twirp — Protobuf-based RPC by Twitch; unary only, no streaming or gRPC compatibility
  • gRPC-Web — requires an Envoy or grpc-web proxy for browsers; ConnectRPC serves browsers directly
  • tRPC — TypeScript-native RPC without Protobuf; ConnectRPC provides cross-language schemas
  • REST/OpenAPI — manual endpoint design; ConnectRPC auto-generates clients and servers from a schema

FAQ

Q: Can I call ConnectRPC services from a browser? A: Yes. The Connect protocol uses standard HTTP and works natively with fetch(). The TypeScript client library handles serialization.

Q: Do I need Envoy or a special proxy? A: No. ConnectRPC handlers serve gRPC, gRPC-Web, and Connect directly on standard HTTP, eliminating the need for a translation proxy.

Q: Which languages does ConnectRPC support? A: Go, TypeScript/JavaScript, Swift, and Kotlin have official client and server libraries. The Connect protocol is simple enough for any HTTP client.

Q: Is ConnectRPC compatible with existing gRPC services? A: Yes. ConnectRPC clients can call standard gRPC servers, and ConnectRPC servers accept standard gRPC clients.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados