Slow MITMProxy performance

We see very poor performance when using MITMProxy in Python. We configure send requests using the Python requests library.

Our program uses the script mode on MITMProxy to create a custom request based on a request from the client, and then returns a response. So, basically, for each request made for the proxy, a new request object is built using requests , then it is forwarded and returned.

How to improve the performance of MITMProxy when it is used to forward requests?

+6
source share
1 answer

I fixed this problem with Juan a while ago, but having received similar questions recently, let me leave the solution here for reference:

mitmproxy has a single stream primitive, so when an inline script processes something, other requests are blocked. Scripts can be run using the libmproxy.script.concurrent decoder. See docs for more information.

(Full disclosure: I created this function)

+6
source

Source: https://habr.com/ru/post/947342/


All Articles