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

Class ProxyConnectionHandler

mitmproxy/proxy/mode_servers.py:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61class ProxyConnectionHandler(server.LiveConnectionHandler):
62 master: Master
63
64 def __init__(self, master, r, w, options, mode):
65 self.master = master
66 super().__init__(r, w, options, mode)
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 1

handle_streamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…