RPC Demystified or Hand-writing a gRPC Handler in 7 Minutes
summary
Handwrites a working gRPC server using only Go's standard library: net/http and encoding/json, converts a REST handler to support streaming by prefixing each message with a five-byte prefix (1 flag byte + 4-byte big-endian length), switches Content-Type to application/grpc+json, and emits gRPC status via HTTP trailers instead of HTTP status. Notes missing robust error checks (overflows, edge cases) but demonstrates a functional handler that interoperates with grpc-go, grpc-java and grpcurl and publishes the example code and a handwritten client on GitHub.
AI-written summary · about








