Hi there, I have a few questions after updating to 4.0.1.
- How it possible to run mitmproxy from separated thread?
Now I’m trying this way:
from mitmproxy import proxy, options
from mitmproxy.master import Master
from mitmproxy.proxy import ProxyServer
opts = options.Options(listen_port=port)
config = proxy.ProxyConfig(opts)
server = ProxyServer(config)
proxy_master = ProxyMaster(opts)
proxy_master.server = server
def run():
asyncio.set_event_loop(asyncio.new_event_loop())
proxy_master.run()
thread = Thread(target=run)
thread.daemon = True
thread.start()
but nothing happens (I know that this code will be exited after executing in thread, but I have a lot of stuff down there)… if I start it through proxy_master.run() in main thread (without threading) - all will work as expected.
- How can I specify cert that will be installed in system, on previous version you have cadir option but now it gone.