本项目基于easyswoole框架实现的聊天室功能,后端与前端分离实现,以websocket协议传输封装好的json格式进行消息的传递
{"controller": "Chat","action": "intoRoom","data":{"roomId":"1000"}}
{"controller": "Chat","action": "sendToRoom","data":{"roomId":"1000","message":"测试消息"}}
{"controller": "Chat","action": "sendToUser","data":{"roomId":"1000","message":"测试消息"}}