toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

how to access request and response data from the proxy server

Open tasin-megamind opened this issue 7 years ago • 3 comments

Hi, I want to manipulate and recognize errors from the requests and response data which are passing through the proxy server. What are is the proper way of doing that? It would be nice to if someone explains it step by step.

tasin-megamind avatar Aug 03 '16 11:08 tasin-megamind

I'm assuming when you say "request and response data" you're referring to HTTP requests and responses. We currently don't have any built in HTTP aware toxics. Though there are plans to add an official one in the future, the present toxic interface makes it possible for you to build one yourself.

jpittis avatar Aug 03 '16 11:08 jpittis

I spent a little time looking at http toxics in the past, and have an example up here: https://github.com/xthexder/toxic-example/blob/master/http.go It only modifies responses, but a similar approach could be used for requests.

If you're willing to compile your own toxiproxy binary, this would be the way to go about this currently.

xthexder avatar Aug 03 '16 20:08 xthexder

thanks for your interest

tasin-megamind avatar Aug 04 '16 16:08 tasin-megamind