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

Method load_file

mitmproxy/addons/view.py:495–509  ·  view source on GitHub ↗

Load flows into the view, without processing them with addons.

(self, path: mitmproxy.types.Path)

Source from the content-addressed store, hash-verified

493
494 @command.command("view.flows.load")
495 def load_file(self, path: mitmproxy.types.Path) -> None:
496 """
497 Load flows into the view, without processing them with addons.
498 """
499 try:
500 with open(path, "rb") as f:
501 for i in io.FlowReader(f).stream():
502 # Do this to get a new ID, so we can load the same file N times and
503 # get new flows each time. It would be more efficient to just have a
504 # .newid() method or something.
505 self.add([i.copy()])
506 except OSError as e:
507 logging.error(e.strerror)
508 except exceptions.FlowReadException as e:
509 logging.error(str(e))
510
511 def add(self, flows: Sequence[mitmproxy.flow.Flow]) -> None:
512 """

Callers 1

test_loadFunction · 0.95

Calls 4

addMethod · 0.95
streamMethod · 0.80
copyMethod · 0.45
errorMethod · 0.45

Tested by 1

test_loadFunction · 0.76