MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / handle_hook

Method handle_hook

mitmproxy/proxy/mode_servers.py:69–75  ·  view source on GitHub ↗
(self, hook: commands.StartHook)

Source from the content-addressed store, hash-verified

67 self.log_prefix = f"{human.format_address(self.client.peername)}: "
68
69 async def handle_hook(self, hook: commands.StartHook) -> None:
70 with self.timeout_watchdog.disarm():
71 # We currently only support single-argument hooks.
72 (data,) = hook.args()
73 await self.master.addons.handle_lifecycle(hook)
74 if isinstance(data, flow.Flow):
75 await data.wait_for_resume() # pragma: no cover
76
77
78M = TypeVar("M", bound=mode_specs.ProxyMode)

Callers

nothing calls this directly

Calls 4

disarmMethod · 0.80
argsMethod · 0.80
handle_lifecycleMethod · 0.80
wait_for_resumeMethod · 0.80

Tested by

no test coverage detected