(ws: WebSocketRoute)
| 347 | log: list[str] = [] |
| 348 | |
| 349 | async def handle_ws(ws: WebSocketRoute) -> None: |
| 350 | def on_message(message: Union[str, bytes]) -> None: |
| 351 | assert isinstance(message, str) |
| 352 | log.append(message) |
| 353 | ws.send("response") |
| 354 | |
| 355 | ws.on_message(on_message) |
| 356 | |
| 357 | # No trailing slash in the route pattern |
| 358 | page.route_web_socket(f"ws://localhost:{server.PORT}", handle_ws) |
nothing calls this directly
no test coverage detected