# WebSocketServer **Repository Path**: Y_wc/WebSocketServer ## Basic Information - **Project Name**: WebSocketServer - **Description**: 使用muduo网络库在Tcp代码基础上封装WebSocet协议 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: https://gitee.com/Y_wc/projects - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-28 - **Last Updated**: 2022-08-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # WebSocketServer #### 介绍 本项目是在做C++服务端项目时,需要有websocket服务需求, 因此使用了muduo网络库。 以原生TCP连接为基础,封装了WebSocket协议。成为一个可用的websocketserver服务。 待改进地方:本项目暂时使用TCPServer上加了一层编解码层来解析websocket协议。 后期打算改进为直接封装TCPServer为websocket,数据到达触发回调改为消息到达出发回调 , ### 软件结构与重点说明 1、thirtpart-websocket 为websocket解析相关类,非常轻量(并非是一个完整的websocket库,只是一个解析作用,可用任何tcp网络库上,可扩展性强) 2、blackServer-muduo TCpServer类, onTextMessage是websocket解析出来的消息。 3、本项目使用了muduo源码中TCPConnection中any类型的Context上下文(websocket的二级缓存在此保存)