livery_grpc_web (livery_grpc v0.1.0)
View SourcegRPC-Web framing.
gRPC-Web carries the same length-prefixed messages as gRPC, but the status
travels in the response body, not in HTTP trailers, so it works over
HTTP/1.1 and through browsers. The trailers are sent as a final frame
whose flag byte has the high bit set (0x80); its payload is an
HTTP/1.1-style name:value\r\n block.
Two content types: application/grpc-web[+proto] is binary;
application/grpc-web-text base64-encodes the whole body (request and
response). This module classifies the request content type and provides
the trailer frame plus the text base64 transforms.
Summary
Functions
The response content-type for a mode.
Decode a request body for a mode: base64 first for the text variant.
Encode a full response body for a mode: base64 for the text variant.
Whether a mode is one of the gRPC-Web variants.
Classify a request content-type into a mode, or undefined if it is not
a gRPC family type.
Build the gRPC-Web trailer frame from a status header list (as
livery_grpc_status:trailers/1,2 returns). The frame flag is 0x80.
Types
Functions
The response content-type for a mode.
Decode a request body for a mode: base64 first for the text variant.
Encode a full response body for a mode: base64 for the text variant.
Whether a mode is one of the gRPC-Web variants.
Classify a request content-type into a mode, or undefined if it is not
a gRPC family type.
Build the gRPC-Web trailer frame from a status header list (as
livery_grpc_status:trailers/1,2 returns). The frame flag is 0x80.