直播系统源码协议探索篇(二):网络套接字协议WebSocket
摘要:
直播系统源码网络套接字协议WebSocket搭建参考代码
import asyncio
import websockets
connected_clients = set()
async def consumer(websocket, path):
connected_clients.add(websocket)
try:
async for message in websocket:
await broadcast(message)
finally:
connected_clients.remove(websocket) 阅读全文
posted @ 2023-08-18 10:27 山东布谷科技小魏 阅读(38) 评论(0) 推荐(0) 编辑