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

Method inject_tcp

mitmproxy/addons/proxyserver.py:353–362  ·  view source on GitHub ↗
(self, flow: Flow, to_client: bool, message: bytes)

Source from the content-addressed store, hash-verified

351
352 @command.command("inject.tcp")
353 def inject_tcp(self, flow: Flow, to_client: bool, message: bytes):
354 if not isinstance(flow, tcp.TCPFlow):
355 logger.warning("Cannot inject TCP messages into non-TCP flows.")
356 return
357
358 event = TcpMessageInjected(flow, tcp.TCPMessage(not to_client, message))
359 try:
360 self.inject_event(event)
361 except ValueError as e:
362 logger.warning(str(e))
363
364 @command.command("inject.udp")
365 def inject_udp(self, flow: Flow, to_client: bool, message: bytes):

Callers 2

test_injectFunction · 0.95
test_inject_failFunction · 0.95

Calls 2

inject_eventMethod · 0.95
TcpMessageInjectedClass · 0.90

Tested by 2

test_injectFunction · 0.76
test_inject_failFunction · 0.76