mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
18 lines
384 B
Python
18 lines
384 B
Python
#!/usr/bin/env python
|
|
|
|
# From https://github.com/aaugustin/websockets/blob/main/example/echo.py
|
|
|
|
import asyncio
|
|
import websockets
|
|
|
|
|
|
async def echo(websocket, path):
|
|
async for message in websocket:
|
|
await websocket.send(message)
|
|
|
|
|
|
async def main():
|
|
async with websockets.serve(echo, "localhost", 8765):
|
|
await asyncio.Future() # run forever
|
|
|
|
asyncio.run(main())
|