MCPcopy
hub / github.com/mitmproxy/mitmproxy / twebsocket

Function twebsocket

mitmproxy/test/tflow.py:271–285  ·  view source on GitHub ↗
(messages: bool = True)

Source from the content-addressed store, hash-verified

269
270
271def twebsocket(messages: bool = True) -> websocket.WebSocketData:
272 ws = websocket.WebSocketData()
273
274 if messages:
275 ws.messages = [
276 websocket.WebSocketMessage(Opcode.BINARY, True, b"hello binary", 946681203),
277 websocket.WebSocketMessage(Opcode.TEXT, True, b"hello text", 946681204),
278 websocket.WebSocketMessage(Opcode.TEXT, False, b"it's me", 946681205),
279 ]
280 ws.close_reason = "Close Reason"
281 ws.close_code = 1000
282 ws.closed_by_client = False
283 ws.timestamp_end = 946681205
284
285 return ws
286
287
288def tflows() -> list[flow.Flow]:

Callers 2

twebsocketflowFunction · 0.85
tflowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…