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

Method handle

mitmproxy/platform/windows.py:95–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 server: APIServer
94
95 def handle(self) -> None:
96 proxifier: TransparentProxy = self.server.proxifier
97 try:
98 pid: int = read(self.rfile)
99 if pid is None:
100 return
101 with proxifier.exempt(pid):
102 while True:
103 c = read(self.rfile)
104 if c is None:
105 return
106 try:
107 server = proxifier.client_server_map[
108 cast(tuple[str, int], tuple(c))
109 ]
110 except KeyError:
111 server = None
112 write(server, self.wfile)
113 except (EOFError, OSError):
114 pass
115
116
117class APIServer(socketserver.ThreadingMixIn, socketserver.TCPServer):

Callers

nothing calls this directly

Calls 3

readFunction · 0.85
writeFunction · 0.85
exemptMethod · 0.80

Tested by

no test coverage detected