ugly ws controller

This commit is contained in:
2024-03-26 17:20:41 +01:00
parent 3576882dc9
commit 01fd2d63f5
6 changed files with 52 additions and 14 deletions
+15
View File
@@ -0,0 +1,15 @@
from websockets.server import WebSocketServerProtocol
class Client:
websocket: WebSocketServerProtocol
def __init__(self, websocket: WebSocketServerProtocol):
self.websocket = websocket
async def listen(self):
async for message in self.websocket:
await self.on_message(message)
async def on_message(self, message):
print(message)