Skip to content

Commit 6279892

Browse files
committed
close connection instead of relaying the message after kill gets called from tcp_message
1 parent 0ad4a59 commit 6279892

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mitmproxy/proxy/layers/tcp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def relay_messages(self, event: events.Event) -> layer.CommandGenerator[None]:
107107
tcp_message = tcp.TCPMessage(from_client, event.data)
108108
self.flow.messages.append(tcp_message)
109109
yield TcpMessageHook(self.flow)
110-
yield commands.SendData(send_to, tcp_message.content)
110+
if self.flow.live:
111+
yield commands.SendData(send_to, tcp_message.content)
112+
else:
113+
yield commands.CloseConnection(send_to, half_close=True)
111114
else:
112115
yield commands.SendData(send_to, event.data)
113116

0 commit comments

Comments
 (0)