Skip to content

wireform-connect

wireform-connect is a native Haskell implementation of the Connect RPC protocol: a client and server for unary and all three streaming RPC kinds, over both HTTP/1.1 and HTTP/2, with binary Protobuf and JSON codecs, GET for side-effect-free unary calls, identity/gzip/br/zstd compression, the gRPC-derived error-code model, leading/trailing metadata, and the streaming EndStreamResponse envelope.

Connect speaks the same Protobuf services as gRPC but over plain HTTP — no HTTP/2 requirement, no custom framing on unary calls, and responses any HTTP client (curl, a browser, fetch) can read directly. Reach for it when you want a gRPC-style service that is also callable from plain HTTP; reach for wireform-grpc when you need gRPC’s wire compatibility.

This page is the package catalogue entry. For the full documentation — setup, serving, calling, and the wire protocol — see the Connect RPC section:

The headline design point: Connect is purely a new transport over the existing service description. The Protobuf serv "meth" tags that loadProtoServices emits for gRPC, plus the message types from loadProto, drive Connect unchanged — there is no Connect-specific code generator. Connect ignores the application/grpc+proto content-type baked into each tag and computes its own from the codec and streaming kind.

ModuleRole
Network.ConnectUmbrella re-export of the public surface
Network.Connect.ServerrunConnectServer, connectHandlers + the service / method registration vocabulary (shared with wireform-grpc), ConnectServerM + metadata accessors
Network.Connect.ClientwithConnectClient + nonStreaming / nonStreamingGet / serverStreaming / clientStreaming / biDiStreaming
Network.Connect.ProtocolCodecs, the content-type matrix, reserved header names, GET query parameters
Network.Connect.ErrorConnectError / ConnectException, the code↔name and code↔HTTP-status tables, the JSON error envelope
Network.Connect.EnvelopeThe streaming frame (1 flag byte + 4-byte length) + EndStreamResponse
Network.Connect.MetadataCustomMetadata ↔ HTTP headers (ASCII / -bin base64 / trailer- prefix)
Network.Connect.Codecproto / JSON message-body (de)serialization
Network.Connect.Compressionidentity / gzip / br / zstd + accept-encoding negotiation
Network.Connect.OpenAPIconnectOpenApi / renderOpenApi — an OpenAPI 3.1 document for a .proto’s Connect services (also wireform-gen openapi)

Like wireform-grpc this is an RPC framework: it owns the Network.Connect.* namespace (not wireform’s per-format <Format>.* convention) and is not re-exported through the umbrella wireform package.

Terminal window
cabal test wireform-connect:wireform-connect-test # in-process loopback, all kinds × both codecs
CONNECT_DEMO=1 cabal test wireform-connect:wireform-connect-test # + real interop vs demo.connectrpc.com