Connect RPC echo server for testing Connect RPC, gRPC, and gRPC-Web clients.
- Multi-protocol support - Single server supports Connect RPC, gRPC, and gRPC-Web
- Protocol flexibility - Each protocol can be individually enabled/disabled via environment variables
- HTTP/1.1 and HTTP/2 - Full support for both HTTP versions
- JSON and Protobuf - Dual encoding support
- Browser compatible - Built-in gRPC-Web support for browser clients
- Reflection API - Full gRPC reflection support (v1 and v1alpha)
- Health checks - Standard gRPC health checking protocol
- Streaming support - Server, client, and bidirectional streaming
docker run -p 8080:8080 ghcr.io/probitas-test/echo-connectrpc:latestdocker compose up echo-connectrpccd echo-connectrpc
just runcurl -X POST http://localhost:8080/echo.v1.Echo/Echo \
-H "Content-Type: application/json" \
-d '{"message": "hello world"}'grpcurl -plaintext -d '{"message": "hello"}' \
localhost:8080 echo.v1.Echo/Echo# List all services
grpcurl -plaintext localhost:8080 list
# Describe a service
grpcurl -plaintext localhost:8080 describe echo.v1.Echo| Variable | Default | Description |
|---|---|---|
HOST |
0.0.0.0 | Host address to bind |
PORT |
8080 | Port number to listen on |
DISABLE_CONNECTRPC |
false | Disable Connect RPC protocol |
DISABLE_GRPC |
false | Disable gRPC protocol |
DISABLE_GRPC_WEB |
false | Disable gRPC-Web protocol |
| Variable | Default | Description |
|---|---|---|
REFLECTION_INCLUDE_DEPENDENCIES |
false | Include transitive dependencies (note: not fully supported) |
DISABLE_REFLECTION_V1 |
false | Disable gRPC reflection v1 API |
DISABLE_REFLECTION_V1ALPHA |
false | Disable gRPC reflection v1alpha API |
Note: At least one protocol must be enabled. The server will refuse to start if all protocols are disabled.
# Run with only Connect RPC protocol
DISABLE_GRPC=true DISABLE_GRPC_WEB=true ./echo-connectrpc
# Run with gRPC protocol disabled
DISABLE_GRPC=true ./echo-connectrpc
# Disable reflection v1alpha for compatibility testing
DISABLE_REFLECTION_V1ALPHA=true ./echo-connectrpc| Feature | echo-grpc | echo-connectrpc |
|---|---|---|
| gRPC Protocol | ✅ | ✅ (can be disabled) |
| Connect RPC Protocol | ❌ | ✅ (can be disabled) |
| gRPC-Web Protocol | ❌ | ✅ (can be disabled) |
| HTTP/1.1 Support | ❌ | ✅ |
| HTTP/2 Support | ✅ | ✅ |
| JSON Encoding | ❌ | ✅ (Connect RPC) |
| Protobuf Encoding | ✅ | ✅ (all protocols) |
| Browser Support | ❌ | ✅ (gRPC-Web built-in) |
| Reflection v1 | ✅ (optional) | ✅ (optional) |
| Reflection v1alpha | ✅ (optional) | ✅ (optional) |
| Custom Reflection | ✅ | ❌ (uses grpcreflect) |
| Dependency Control | ✅ | |
| API Compatibility | - | 100% (same .proto files) |
See docs/api.md for complete API reference.
- Go 1.24+
- protoc
- protoc-gen-go
- protoc-gen-connect-go
Or use Nix:
nix develop# List available commands
just
# Run linter
just lint
# Run tests
just test
# Build binary
just build
# Run server
just run
# Format code
just fmt
# Clean artifacts
just cleanProtobuf code is generated automatically during build:
just generateThis generates:
proto/*.pb.go- Protobuf message definitionsproto/*.connect.go- Connect RPC service stubs
MIT