grpc-server-reflection
Ruby gem implementing the gRPC Server Reflection Protocol. Enables tools like grpcurl, grpcui, and Postman to introspect your gRPC services without .proto files.
Installation
Add to your Gemfile:
gem 'grpc-server-reflection'Usage
require 'grpc_server_reflection'
server = GRPC::RpcServer.new
server.add_http2_port('0.0.0.0:50051', :this_port_is_insecure)
server.handle(MyApp::GreeterService)
server.handle(GrpcServerReflection::Service) # Add reflection
server.handle(GrpcServerReflection::V1AlphaService) # Add v1alpha reflection
server.runThen use grpcurl to test:
grpcurl -plaintext localhost:50051 listRequirements
- Ruby >= 2.7
- grpc gem (~> 1.0)
- google-protobuf gem (~> 3.0)
License
MIT