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)
source share