gdong42 / grpc-mate Goto Github PK
View Code? Open in Web Editor NEWA dynamic proxy server that translates JSON HTTP requests into gRPC calls.
Home Page: https://grpcmate.io
License: Apache License 2.0
A dynamic proxy server that translates JSON HTTP requests into gRPC calls.
Home Page: https://grpcmate.io
License: Apache License 2.0
Currently grpc-mate supports only unary calls. It would be nice to support streaming as well. Need to address how to workaround client/server streaming with HTTP/1.1
Also, add instructions on how to install and run via docker.
Currently grpc-mate returns HTTP status code 502
when backend gRPC server does not support reflection. It might be more user-friendly to also give a descriptive message about this fact.
Is it possible to set custom headers?
I can't interact with grpc-mate by browser
Maybe provide something like auto inject container to pods that have specific metadata tags. Like grpc-mate.enabled
, or something better.
Currently grpc-mate provides /actuator/services
endpoint that returns all services, methods and types. An example response:
{
"services":[
{
"name":"grpc.examples.echo.Echo",
"methods":[
{
"name":"UnaryEcho",
"input":"grpc.examples.echo.EchoRequest",
"output":"grpc.examples.echo.EchoResponse",
"route":"/grpc.examples.echo.Echo/UnaryEcho"
},
{
"name":"ServerStreamingEcho",
"input":"grpc.examples.echo.EchoRequest",
"output":"grpc.examples.echo.EchoResponse",
"route":"/grpc.examples.echo.Echo/ServerStreamingEcho"
},
{
"name":"ClientStreamingEcho",
"input":"grpc.examples.echo.EchoRequest",
"output":"grpc.examples.echo.EchoResponse",
"route":"/grpc.examples.echo.Echo/ClientStreamingEcho"
},
{
"name":"BidirectionalStreamingEcho",
"input":"grpc.examples.echo.EchoRequest",
"output":"grpc.examples.echo.EchoResponse",
"route":"/grpc.examples.echo.Echo/BidirectionalStreamingEcho"
}
]
},
{
"name":"grpc.reflection.v1alpha.ServerReflection",
"methods":[
{
"name":"ServerReflectionInfo",
"input":"grpc.reflection.v1alpha.ServerReflectionRequest",
"output":"grpc.reflection.v1alpha.ServerReflectionResponse",
"route":"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"
}
]
},
{
"name":"helloworld.Greeter",
"methods":[
{
"name":"SayHello",
"input":"helloworld.HelloRequest",
"output":"helloworld.HelloReply",
"route":"/helloworld.Greeter/SayHello"
}
]
}
],
"types":[
{
"name":"grpc.examples.echo.EchoResponse",
"template":{
"message":""
}
},
{
"name":"grpc.reflection.v1alpha.ServerReflectionRequest",
"template":{
"host":"",
"fileContainingExtension":{
"containingType":"",
"extensionNumber":0
}
}
},
{
"name":"grpc.reflection.v1alpha.ServerReflectionResponse",
"template":{
"validHost":"",
"originalRequest":{
"host":"",
"fileContainingExtension":{
"containingType":"",
"extensionNumber":0
}
},
"errorResponse":{
"errorCode":0,
"errorMessage":""
}
}
},
{
"name":"helloworld.HelloRequest",
"template":{
"name":""
}
},
{
"name":"helloworld.HelloReply",
"template":{
"message":""
}
},
{
"name":"grpc.examples.echo.EchoRequest",
"template":{
"message":""
}
}
]
}
The resulting output could be quite long and hard to read for a real-world gRPC server that has loads of services. It would be nice to filter these results by service name
and method
to only show relevant parts.
e.g.
/actuator/services?name=grpc.examples.echo.Echo
returns only service with name grpc.examples.echo.Echo, its methods, and types that are relevant./actuator/services?method=ServerStreamingEcho
returns services that have method name as ServerStreamingEcho, this method, and types that are relevant.Of course, both name
and method
can be specified at the same time.
Not sure if filtering type
is a valid use case as well. Let's not add the type
parameter for now. Keep it simple.
Hi.
I have been having issues discovering services that supposedly have ServerReflection enabled. I am running the helloworld example from the grpc official repository.
However, when I try to access it via grpc-mate, it seems like it is unable to discover it, and I have been unable to find any issues or guides that would help me figure out what is not working.
Thank you before hand for your time.
For users that develop gRPC services alongside gRPC Mate, a web UI of the latter is handy. User can check with services/methods they are working on, and quickly shoot a gRPC call with JSON payload through the web UI and check the results.
Although one can achieve the same using CLI commands, it would be more efficient to click around using a UI while he/she is debugging.
Features Must Have:
Features Nice to Have:
Some considerations on implementation:
-ui
I keep getting the following error from my gRPC server:
2022/07/10 16:42:10 http: TLS handshake error from 172.22.224.1:60652: tls: first record does not look like a TLS handshake
Any chance of TLS being supported in the future? I'm not sure what I'll try next. I've been using grpc-mate from within Docker.
Inspect if the target gRPC service has a health check service registered, monitor the service result, if it returns non-OK status, gRPC Mate can show something like DOWN
or 503 status to indicate the health status.
The health check probe should be scheduled at a fixed rate, with frequency set to 10s or so, and the frequency should be adjustable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.