Coder Social home page Coder Social logo

gdong42 / grpc-mate Goto Github PK

View Code? Open in Web Editor NEW
73.0 3.0 9.0 3.55 MB

A dynamic proxy server that translates JSON HTTP requests into gRPC calls.

Home Page: https://grpcmate.io

License: Apache License 2.0

Go 99.27% Dockerfile 0.73%
grpc grpc-gateway grpc-mate rest-api grpc-proxy

grpc-mate's People

Contributors

gdong42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grpc-mate's Issues

Support streaming calls

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

Support filtering results from /actuator/services endpoint

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.

Unable to discover service

Hi.
I have been having issues discovering services that supposedly have ServerReflection enabled. I am running the helloworld example from the grpc official repository.
image

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.
image

Thank you before hand for your time.

Add web GUI support

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:

  • Show information of the backend gRPC service it connects to, e.g. the address, the port, etc
  • List all services and methods the backend exposes.
  • Easy to construct a request with selected service/method, with optional input message ( better pre-filled with sample values)
  • Show the result status code and result message, or error message if the request is not successful

Features Nice to Have:

  • Health check status

Some considerations on implementation:

  • it should be opt-in by an optional command line flag, e.g. -ui
  • the static resources including the template files should be packaged into the standalone executable binary.

TLS handshake errors (gRPC requires TLS)

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.

Support gRPC HealthCheck

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.