MCPcopy Create free account
hub / github.com/encode/starlette / on_receive

Method on_receive

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

Source from the content-addressed store, hash-verified

93 encoding = "bytes"
94
95 async def on_receive(self, websocket: WebSocket, data: bytes) -> None:
96 await websocket.send_bytes(b"Message bytes was: " + data)
97
98 client = test_client_factory(WebSocketApp)
99 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