Bump mitmproxy and protobuf version

This commit is contained in:
Jerry Yan 2022-06-12 00:46:07 +08:00
parent 705cf09741
commit 0edb398e20
2 changed files with 16 additions and 15 deletions

View File

@ -18,17 +18,20 @@ _manager: "Optional[ProxyManager]" = None
class ProxyManager:
def __init__(self):
self._mitm_instance = None
self._loop: "Optional[asyncio.AbstractEventLoop]" = None
self._loop: "asyncio.AbstractEventLoop" = asyncio.new_event_loop()
opts = Options(
listen_host=config()['mitm']['host'],
listen_port=config()['mitm']['port'],
)
self._mitm_instance = DumpMaster(options=opts)
self._load_addon()
opts.update_defer(
flow_detail=0,
termlog_verbosity="error",
)
async def _init_mitm_instance():
self._mitm_instance = DumpMaster(options=opts)
self._load_addon()
opts.update_defer(
flow_detail=0,
termlog_verbosity="error",
)
_loop = asyncio.get_event_loop()
_loop.run_until_complete(_init_mitm_instance())
self._thread = None
def __del__(self):
@ -45,13 +48,12 @@ class ProxyManager:
self._mitm_instance.addons.add(DanmakuWebsocketAddon(MESSAGE_QUEUE))
def _start(self):
loop = asyncio.new_event_loop()
self._loop = loop
asyncio.set_event_loop(loop)
self._mitm_instance.run()
asyncio.set_event_loop(self._loop)
if self._mitm_instance:
self._loop.run_until_complete(self._mitm_instance.run())
def start_loop(self):
self._thread = threading.Thread(target=self._start)
self._thread = threading.Thread(target=self._start, args=())
self._thread.start()
def join(self):

View File

@ -1,6 +1,5 @@
colorama==0.4.4
selenium==4.1.0
requests==2.27.1
mitmproxy~=7.0.4
protobuf<3.19
mitmproxy~=8.1.0
protobuf~=3.20.1