Intermediate LevelREST APIs & Web Services
How does gRPC-Web and Envoy gRPC Transcoding bridge browser clients to gRPC backends?
❓ Interview Prompt: Explain gRPC browser limitations (lack of HTTP/2 frame control access), gRPC-Web spec, and Envoy proxy JSON-to-gRPC transcoding.
Browsers cannot issue native gRPC calls directly because JavaScript APIs do not expose fine-grained HTTP/2 frame control:
2 Bridge Solutions:
1
gRPC-Web Protocol: Client uses 'grpc-web' JS library, sending gRPC-Web encoded HTTP/1.1 or HTTP/2 POST requests. An Envoy proxy translates gRPC-Web frames to native gRPC.
2
Envoy gRPC-JSON Transcoding: Translates standard REST JSON HTTP requests ('POST /v1/users') into binary gRPC calls automatically using OpenAPI annotations in '.proto' files!
Code Implementation Example
yaml
# Envoy gRPC-JSON Transcoder Filter Config
name: envoy.filters.http.grpc_json_transcoder
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
proto_descriptor: "/etc/envoy/proto.pb"
services: ["UserService"]💡Envoy proxy gRPC-JSON transcoding filter configuration.
🎯 Interview Key Takeaway
Envoy gRPC transcoding translates external REST JSON HTTP requests into internal binary gRPC calls seamlessly.
#gRPC-Web#Envoy#Transcoding#Intermediate
Back to all REST APIs & Web Services Questions→