Skip to content

Add echo-connectrpc server with multi-protocol support - #14

Merged
lambdalisue merged 1 commit into
mainfrom
feature/add-echo-connectrpc
Dec 5, 2025
Merged

lambdalisue merged 1 commit into
mainfrom
feature/add-echo-connectrpc

Conversation

@lambdalisue

Copy link
Copy Markdown
Member

Summary

Add a new Connect RPC echo server (echo-connectrpc) with the same interface as echo-grpc, supporting multiple protocols on a single port.

Key Features

  • Multi-protocol support: Connect RPC, gRPC, and gRPC-Web
  • Protocol control: Each protocol can be individually enabled/disabled via environment variables
  • HTTP/1.1 and HTTP/2: Full support for both HTTP versions via h2c
  • Dual encoding: JSON and Protocol Buffers
  • Browser compatible: Built-in gRPC-Web support
  • Reflection API: Full gRPC reflection (v1 and v1alpha) with version control
  • 100% API compatible: Same .proto files and RPC interface as echo-grpc

Environment Variables

  • DISABLE_CONNECTRPC, DISABLE_GRPC, DISABLE_GRPC_WEB - Protocol control
  • DISABLE_REFLECTION_V1, DISABLE_REFLECTION_V1ALPHA - Reflection version control
  • REFLECTION_INCLUDE_DEPENDENCIES - Dependency control (partially supported)

Implementation Details

  • Uses connectrpc.com/connect for multi-protocol support
  • Protocol filter middleware for runtime protocol control
  • httptest-based unit tests (16 tests, all passing)
  • Docker multi-arch build (linux/amd64, linux/arm64)
  • GitHub Actions CI/CD workflows

Comparison with echo-grpc

Feature echo-grpc echo-connectrpc
gRPC ✅ ✅ (configurable)
Connect RPC ❌ ✅ (configurable)
gRPC-Web ❌ ✅ (configurable)
HTTP/1.1 ❌ ✅
JSON ❌ ✅
Browser support ❌ ✅

Test Plan

  • All unit tests pass (16/16, 1 skipped for HTTP/2 limitation)
  • Integration tests pass (curl, grpcurl)
  • Protocol filtering works (DISABLE_* env vars tested)
  • Reflection version control works (v1/v1alpha tested)
  • All protocols disabled correctly fails with error message
  • just lint - 0 issues
  • just test - all tests pass
  • just build - successful build
  • Docker Compose integration added (port 18081)
  • GitHub Actions workflows created
  • Documentation complete (README.md, CLAUDE.md, docs/api.md)

Files Added

  • echo-connectrpc/ - Complete Connect RPC server implementation
  • .github/workflows/build.echo-connectrpc.yml - Build workflow
  • .github/workflows/docker.echo-connectrpc.yml - Docker publish workflow
  • Updated root README.md, CLAUDE.md, justfile, compose.yaml

@lambdalisue
lambdalisue force-pushed the feature/add-echo-connectrpc branch from e0b85f9 to 169d10a Compare December 5, 2025 17:09
Implement Connect RPC echo server with the same interface as echo-grpc,
supporting Connect RPC, gRPC, and gRPC-Web protocols on a single port.

Features:
- Multi-protocol support (Connect RPC, gRPC, gRPC-Web)
- Protocol-specific enable/disable via environment variables
- Reflection API with version control (v1 and v1alpha)
- HTTP/1.1 and HTTP/2 support via h2c
- JSON and Protobuf encoding
- Browser-compatible gRPC-Web built-in
- Complete unit test coverage (16 tests)
- Same RPC interface as echo-grpc (100% API compatible)

Environment variables:
- DISABLE_CONNECTRPC, DISABLE_GRPC, DISABLE_GRPC_WEB
- DISABLE_REFLECTION_V1, DISABLE_REFLECTION_V1ALPHA
- REFLECTION_INCLUDE_DEPENDENCIES (partially supported)

All tests pass: lint, test, build verified.
@lambdalisue
lambdalisue force-pushed the feature/add-echo-connectrpc branch from 169d10a to 47e7e7c Compare December 5, 2025 17:12
@lambdalisue
lambdalisue merged commit c40a65d into main Dec 5, 2025
12 checks passed
@lambdalisue
lambdalisue deleted the feature/add-echo-connectrpc branch December 5, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant