mitmproxy实例化方法更新
This commit is contained in:
parent
dc373acc27
commit
e2f582204a
@ -30,19 +30,18 @@ class ProxyManager:
|
|||||||
flow_detail=0,
|
flow_detail=0,
|
||||||
termlog_verbosity="error",
|
termlog_verbosity="error",
|
||||||
)
|
)
|
||||||
_loop = asyncio.get_event_loop()
|
self._loop.run_until_complete(_init_mitm_instance())
|
||||||
_loop.run_until_complete(_init_mitm_instance())
|
|
||||||
self._thread = None
|
self._thread = None
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.terminate()
|
self.terminate()
|
||||||
|
|
||||||
def terminate(self):
|
def terminate(self):
|
||||||
|
if self._mitm_instance:
|
||||||
|
self._mitm_instance.shutdown()
|
||||||
if self._loop:
|
if self._loop:
|
||||||
if self._loop.is_running():
|
if self._loop.is_running():
|
||||||
self._loop.stop()
|
self._loop.stop()
|
||||||
if self._mitm_instance:
|
|
||||||
self._mitm_instance.shutdown()
|
|
||||||
|
|
||||||
def _load_addon(self):
|
def _load_addon(self):
|
||||||
self._mitm_instance.addons.add(DanmakuWebsocketAddon(MESSAGE_QUEUE))
|
self._mitm_instance.addons.add(DanmakuWebsocketAddon(MESSAGE_QUEUE))
|
||||||
|
Reference in New Issue
Block a user