I’m using mitmporxy module in my project just like in flowbasic.py example from mitmproxy 2.x. So in short it was like this (in my case I start a thread and I communicate with another process and send some XML files that I need to check):
class MyMaster(master.Master): def run(self): try: master.Master.run(self) except KeyboardInterrupt: self.shutdown() [..] @controller.handler def response(self, f): DO_MY_STUFF(f) [..] opts = options.Options(cadir="~/.mitmproxy/") config = ProxyConfig(opts) server = ProxyServer(config) m = MyMaster(opts, server) m.run()
For the version 3 there is no example flowbasic.py and reading the docs and checking the source won’t give me a clue how to put response function.
Do anyone have such flowbasic.py for v3 prepared or some ideas?