Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to proxy gRPC calls

I'm trying to analyse what information an app is sending so I setup Charles but to my surprise nothing was logged out.

After decompiling the app I see that it doesn't use simple REST calls but rather a library called gRPC.

Is there a good tool out there that will allow me too see what is send out from the app?

like image 374
Paulus2 Avatar asked Oct 21 '17 13:10

Paulus2


People also ask

Does gRPC work with proxies?

The gRPC proxy supports multiple etcd server endpoints.

What is a gRPC proxy?

gRPC proxy is a Go reverse proxy that allows for rich routing of gRPC calls with minimum overhead.

Does gRPC Web require proxy?

The gRPC protocol uses features of HTTP/2 that cannot be controlled by JavaScript. So that a proxy is required.

Why does gRPC need a proxy?

If a browser supports HTTP 2, why is a proxy needed? gRPC needs access HTTP/2 trailers, which is not supported in browsers today. This necessitates translation in a proxy of some form.


2 Answers

The Mediator is a Cross-platform GUI gRPC debugging proxy like Charles but design for gRPC.

You can dump all gRPC requests without any configuration, if you need to resolve the message body, the gRPC server needs to support the Server Reflection feature.

like image 92
HIGAN Avatar answered Dec 01 '22 21:12

HIGAN


gRPC uses HTTP/2 as a transport protocol. Any proxy which supports HTTP/2 for both the front-end and back-end connections should be able to be used to inspect the packets a gRPC connection. Note, some proxies only support HTTP/2 for the front-end or back-end connections and those are incompatible with gRPC.

Envoy Proxy (https://www.envoyproxy.io/) supports proxying gRPC connections and can be configured to log out request information.

Some other example proxies include:

  • Nginx https://medium.com/nirman-tech-blog/nginx-as-reverse-proxy-with-grpc-820d35642bff
  • https://github.com/mwitkow/grpc-proxy
  • https://github.com/mercari/grpc-http-proxy
like image 35
dolan Avatar answered Dec 01 '22 21:12

dolan