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

Function tcp_message

examples/addons/tcp-simple.py:20–26  ·  view source on GitHub ↗
(flow: tcp.TCPFlow)

Source from the content-addressed store, hash-verified

18
19
20def tcp_message(flow: tcp.TCPFlow):
21 message = flow.messages[-1]
22 message.content = message.content.replace(b"foo", b"bar")
23
24 logging.info(
25 f"tcp_message[from_client={message.from_client}), content={strutils.bytes_to_escaped_str(message.content)}]"
26 )

Callers

nothing calls this directly

Calls 2

infoMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…