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

Method on_connect

starlette/endpoints.py:119–121  ·  view source on GitHub ↗

Override to handle an incoming websocket connection

(self, websocket: WebSocket)

Source from the content-addressed store, hash-verified

117 return message["text"] if message.get("text") else message["bytes"]
118
119 async def on_connect(self, websocket: WebSocket) -> None:
120 """Override to handle an incoming websocket connection"""
121 await websocket.accept()
122
123 async def on_receive(self, websocket: WebSocket, data: Any) -> None:
124 """Override to handle an incoming websocket message"""

Callers 1

dispatchMethod · 0.95

Calls 1

acceptMethod · 0.80

Tested by

no test coverage detected