Skip to content

ConnectRPC support for gRPC service #619

@ii64

Description

@ii64

Feature Request

Crates

volo-grpc

Motivation

ConnectRPC allows gRPC services to be called directly from browsers and with tools like cURL, without needing proxies or gateways. This would make Volo services much easier to integrate with web frontends.

Example - calling a service with cURL:

curl --header "Content-Type: application/json" \
     --data '{"name": "test"}' \
     https://api.example.com/service.v1.MyService/Method

Proposal

Add ConnectRPC protocol support to volo-grpc so a single server can handle:

  • Standard gRPC (for service-to-service)
  • Connect protocol (for browsers, buf curl and its toolchain)

The implementation would detect the protocol based on Content-Type headers and handle Connect's simpler HTTP/1.1 compatible format for unary calls. For streaming RPC I think it's a bit tricky, especially for the bidirectional streaming as it currently only supported with HTTP/2 transport, however there's a potential where it can be established with HTTP/1.1 by doing chunked transfer encoding, and to note that the server should support full duplex (eg. in Go https://pkg.go.dev/net/http#ResponseController.EnableFullDuplex)

Alternatives

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions