From 5cdd2bc6ec9dc7bc3e2154fbf332b71515fc44d2 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 27 Feb 2022 07:58:00 +0100 Subject: [PATCH] docs: `TCPFlow.messages` --- mitmproxy/tcp.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mitmproxy/tcp.py b/mitmproxy/tcp.py index ec3c78b67..a6aea64b8 100644 --- a/mitmproxy/tcp.py +++ b/mitmproxy/tcp.py @@ -40,9 +40,16 @@ class TCPFlow(flow.Flow): A TCPFlow is a simplified representation of a TCP session. """ + messages: List[TCPMessage] + """ + The messages transmitted over this connection. + + The latest message can be accessed as `flow.messages[-1]` in event hooks. + """ + def __init__(self, client_conn, server_conn, live=None): super().__init__("tcp", client_conn, server_conn, live) - self.messages: List[TCPMessage] = [] + self.messages = [] _stateobject_attributes = flow.Flow._stateobject_attributes.copy() _stateobject_attributes["messages"] = List[TCPMessage]