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

Method load_flow

mitmproxy/master.py:125–145  ·  view source on GitHub ↗

Loads a flow

(self, f)

Source from the content-addressed store, hash-verified

123 )
124
125 async def load_flow(self, f):
126 """
127 Loads a flow
128 """
129
130 if (
131 isinstance(f, http.HTTPFlow)
132 and len(self.options.mode) == 1
133 and self.options.mode[0].startswith("reverse:")
134 ):
135 # When we load flows in reverse proxy mode, we adjust the target host to
136 # the reverse proxy destination for all flows we load. This makes it very
137 # easy to replay saved flows against a different host.
138 # We may change this in the future so that clientplayback always replays to the first mode.
139 mode = ReverseMode.parse(self.options.mode[0])
140 assert isinstance(mode, ReverseMode)
141 f.request.host, f.request.port, *_ = mode.address
142 f.request.scheme = mode.scheme
143
144 for e in eventsequence.iterate(f):
145 await self.addons.handle_lifecycle(e)

Callers 2

postMethod · 0.45
load_flowsMethod · 0.45

Calls 3

handle_lifecycleMethod · 0.80
parseMethod · 0.45
iterateMethod · 0.45

Tested by

no test coverage detected