MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / dump

Method dump

examples/contrib/jsondump.py:178–192  ·  view source on GitHub ↗

Transform and dump (write / send) a data frame.

(self, frame)

Source from the content-addressed store, hash-verified

176 self.queue.task_done()
177
178 def dump(self, frame):
179 """
180 Transform and dump (write / send) a data frame.
181 """
182 for tfm in self.transformations:
183 for field in tfm["fields"]:
184 self.transform_field(frame, field, tfm["func"])
185 frame = self.convert_to_strings(frame)
186
187 if self.outfile:
188 self.lock.acquire()
189 self.outfile.write(json.dumps(frame) + "\n")
190 self.lock.release()
191 else:
192 requests.post(self.url, json=frame, auth=(self.auth or None))
193
194 @staticmethod
195 def load(loader):

Callers 1

workerMethod · 0.95

Calls 5

transform_fieldMethod · 0.95
convert_to_stringsMethod · 0.95
dumpsMethod · 0.80
writeMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected