☰
Debian Codegraph
@
2.24.0-1
/
/
docs
/
examples
/
websockets
/
sending_bytes.py
☽
☼
docs/examples/websockets/sending_bytes.py
code
plain
raw
Expat
Alc <
[email protected]
>,; Cody Fincher <
[email protected]
>,; Jacob Coffee <
[email protected]
>,; Janek Nouvertné <
[email protected]
>,; Litestar Developers <
[email protected]
>,; Peter Schutt <
[email protected]
>,; Visakh Unnikrishnan <
[email protected]
>,
debian/copyright
1
from litestar import Litestar, websocket_listener
2
3
4
@websocket_listener("/")
5
async def handler(data: str) -> bytes:
6
return data.encode("utf-8")
7
8
9
app = Litestar([handler])