MCPcopy
hub / github.com/mitmproxy/mitmproxy / UDPMessage

Class UDPMessage

mitmproxy/udp.py:8–31  ·  view source on GitHub ↗

An individual UDP datagram.

Source from the content-addressed store, hash-verified

6
7
8class UDPMessage(serializable.Serializable):
9 """
10 An individual UDP datagram.
11 """
12
13 def __init__(self, from_client, content, timestamp=None):
14 self.from_client = from_client
15 self.content = content
16 self.timestamp = timestamp or time.time()
17
18 @classmethod
19 def from_state(cls, state):
20 return cls(*state)
21
22 def get_state(self):
23 return self.from_client, self.content, self.timestamp
24
25 def set_state(self, state):
26 self.from_client, self.content, self.timestamp = state
27
28 def __repr__(self):
29 return "{direction} {content}".format(
30 direction="->" if self.from_client else "<-", content=repr(self.content)
31 )
32
33
34class UDPFlow(flow.Flow):

Callers 2

test_injectFunction · 0.90
test_msg_injectMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_injectFunction · 0.72
test_msg_injectMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…