MCPcopy
hub / github.com/encode/starlette / on_receive

Method on_receive

tests/test_endpoints.py:84–85  ·  view source on GitHub ↗
(self, websocket: WebSocket, data: bytes)

Source from the content-addressed store, hash-verified

82 encoding = "bytes"
83
84 async def on_receive(self, websocket: WebSocket, data: bytes) -> None:
85 await websocket.send_bytes(b"Message bytes was: " + data)
86
87 client = test_client_factory(WebSocketApp)
88 with client.websocket_connect("/ws") as websocket:

Callers

nothing calls this directly

Calls 3

send_bytesMethod · 0.45
send_jsonMethod · 0.45
send_textMethod · 0.45

Tested by

no test coverage detected