We are seeing very poor performance while using MITMProxy in Python. We are custom forwarding requests using the requests
Python library.
Our program uses the script mode on MITMProxy to create a custom request based on the request from a client and then return the response. So, basically, for every request made to the proxy, a new request object is built with requests
, then forwarded and then returned.
How can I increase the performance of MITMProxy when using it to forward requests?
I fixed this issue with Juan a while ago, but having received similar questions lately, let me leave the solution here for reference:
mitmproxy has a single flow primitive, so when an inline script is handling something, other requests block. Scripts can be run threaded by using the libmproxy.script.concurrent
decorator. For more details, have a look at the docs.
(Full disclosure: I authored this feature)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With