You are browsing unreleased documentation.
Looking for the plugin's configuration parameters? You can find them in the gRPC-Web configuration reference doc.
The gRPC-Web plugins allows access to a gRPC service via the gRPC-Web protocol. Primarily, this means JavaScript browser applications using the gRPC-Web library.
A service that presents a gRPC API can be used by clients written in many languages, but the network specifications are oriented primarily to connections within a data center. gRPC-Web lets you expose the gRPC API to the Internet so that it can be consumed by browser-based JavaScript applications.
This plugin translates requests and responses between gRPC-Web and gRPC. The plugin supports both HTTP/1.1 and HTTP/2, over plaintext (HTTP) and TLS (HTTPS) connections.
Why gRPC?
Unlike JSON, gRPC is a binary protocol, using Protobuf definitions to instruct how the data is marshalled and unmarshalled. Because binary data is used instead of text, it’s a more efficient way to transmit data over a network. However, this also makes gRPC harder to work with, because inspecting what went wrong is more challenging. Additionally, few clients natively handle gRPC.
To help alleviate the challenges of working with gRPC, Kong has two plugins:
- gRPC-Gateway
- gRPC-Web
For flexibility and compatibility with RESTful expectations, the gRPC-Gateway plugin offers more configurability, whereas the gRPC-Web plugin adheres more directly to the Protobuf specification.