from quart import websocket, Quart app = Quart(__name__) @app.websocket("/") async def ws(): await websocket.accept() while True: msg = await websocket.receive() await websocket.send(msg) if __name__ == "__main__": app.run(port=8000)