This repository has been archived on 2025-07-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
tetri5-backend/main.py
2021-07-01 01:49:30 -04:00

15 lines
340 B
Python

#!/usr/bin/env python
import asyncio
import os
import websockets
async def echo(websocket, path):
async for message in websocket:
await websocket.send(message)
start_server = websockets.serve(echo, "", int(os.environ["PORT"]))
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()