Compare commits

...

2 commits

Author SHA1 Message Date
cbaef0c7a0 Grammarly 2024-06-17 19:24:50 -04:00
62b4080635 Bombed HI command 2024-06-17 19:24:40 -04:00
2 changed files with 1 additions and 9 deletions

View file

@ -14,8 +14,7 @@ You run the server by:
You can send raw text to the WS server. This text is in form of commands:
- `HI` will reply with a message response;
- `GET` will reply with a message response too;
- `GET` will reply with a message response;
- `MSG {token} {message}` will set the message and broadcast it to all logged-in clients;
- `CLEAR {token}` will clear the current message.

View file

@ -17,13 +17,6 @@ async def handle(websocket):
if websocket not in CONNECTIONS:
CONNECTIONS.add(websocket)
async for message in websocket:
# parse message
if message == "HI":
# new client said hi
if message == "":
await websocket.send("HI")
else:
await websocket.send(f"HI {EAS_MESSAGE}")
if message == "GET":
await websocket.send(f"MSG {EAS_MESSAGE}")
if message.startswith(f"MSG {TOKEN} "):