doc/PROTOCOL-WEB.md
gRPC-Web provides a JS client library that supports the same API as gRPC-Node to access a gRPC service. Due to browser limitation, the Web client library implements a different protocol than the native gRPC protocol. This protocol is designed to make it easy for a proxy to translate between the protocols as this is the most likely deployment model.
This document lists the differences between the two protocols. To help tracking future revisions, this document describes a delta with the protocol details specified in the native gRPC protocol.
For the gRPC-Web protocol, we have decided on the following design goals:
While the new protocol will be published/reviewed publicly, we also intend to keep the protocol as an internal detail to gRPC-Web. More specifically, we expect the protocol to
Content-Type
HTTP wire protocols
HTTP/2 related behavior (specified in gRPC over HTTP2)
Message framing (vs. http2-transport-mapping)
key1: foo\r\n
key2: bar\r\n
10000000b: an uncompressed trailer (as part of the body)
10000001b: a compressed trailer
User Agent
Text-encoded (response) streams
Retries, caching
Keep-alive
Bidi-streaming, with flow-control
Versioning
Browser-specific features