I have a service which serves requests over gRPC. I'm using Hoverfly for mocking that service in my tests. Ordinarily, I use grpcurl for gRPC requests on my terminal. But for these tests, I need to add a proxy to the gRPC requests so they can hit Hoverfly instead of the service and a mocked response is delivered.
For regular HTTP requests, I can do this by adding a --proxy flag to curl like
curl --proxy http://localhost:8500 http://time.jsontest.com
Is there a way to do this for gRPC requests (preferably via grpcurl but wouldn't mind using another tool)?
Related
It seems like quic-go does not support proxy for HTTP request like HTTP/2 module, how can I use HTTP/S proxy or SOCKS5 proxy with quic-go for HTTP requests?
The quic-go package doesn't seem to have native proxy support (it does have a class called proxy, but it appears to be a tool for testing packet loss and delays).
How about extending it yourself (or dynamically wrapping it) with net/proxy and then using this to forward your requests through a SOCKS5 proxy?
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?
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.
Mediator can render the binary message into a JSON tree, when you have the API schema.
It support decode gRPC/TLS, but you should download and install the Mediator Root Certificate to your device.
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
If you are asking for android there is a app called HttpCanry. It can log request/ respond.
I am just working on proxy server load test. I running the JMeter with properties jmeter -H <my proxy domain> -P <my proxy port>. The proxy will work if we override the User-Agent with our custom User-Agent, and i am using HTTP Header Manager to do the job.
The problem is, it's worked if i am hit into HTTP protocol, but the JMeter won't override the user-agent if i hit into HTTPS Protocol. Am i missing something ?
I am already checking the proxy via browser, and it's working fine.
Thanks
I want to add a custom header to HTTP Connect requests as a means for customized communication with a proxy.
Is there a way to do this? Ideally I would do it through a Network Interceptor that sees the HTTP Connect requests. But this doesn't seem to be the case by default when testing with a sample application.
Thanks,
Y.
Is there a way to let haproxy or squid to run a (bash)script (or another http request) before performing the proxying of the incoming requests?
I want to host a userX specific http server(and service) at userX.mydomain.com, but these kind of services can be running or not, depending on the load of the machine that hosts them.
So the first time in the day, the userX access to the url userX.mydomain.com, the http server hosting the serviceX has to be started.
I already managed, thanks to haproxy, xinetd, some bash script, and the "HTTP Refresh header directive" to perform a refresh after the http server/service start..
but now I would like to make it even better, to let the "http service starting" to be transparent to the client asking for a GET, a PUT or a POST, and to immediately reply correctly, with the correct service response even at the first http request.
So I will need to start the service and then immediately proxying the request to the service just started.
I already try the "http-check" and "check" options in haproxy but I don't think they can be useful to me, because the healt checks are asynchrnous to the request handling of haproxy. Instead, I will need to perform this script execution for each request and before that haproxy proxies the request..
If squid allows to perform this kind of action, I can even let haproxy to proxy the request to squid, that then, can start the service and proxy the request
Does someone have an idea to achieve it?
Thanks in advance.
This can be done using proxymachine - https://github.com/mojombo/proxymachine
Basically proxymachine can intercept the HTTP request, parse the headers, run arbitrary Ruby code, and then forward the connection.
You would need to terminate the SSL prior to proxymachine getting the connection - e.g. using haproxy (with the new SSL capability).