完善websocket

This commit is contained in:
xiongziliang 2019-04-02 15:07:54 +08:00
parent 33ff630e9b
commit 791d84d08e

View File

@ -190,6 +190,9 @@ inline bool HttpSession::checkWebSocket(){
headerOut["Upgrade"] = "websocket";
headerOut["Connection"] = "Upgrade";
headerOut["Sec-WebSocket-Accept"] = Sec_WebSocket_Accept;
if(!_parser["Sec-WebSocket-Protocol"].empty()){
headerOut["Sec-WebSocket-Protocol"] = _parser["Sec-WebSocket-Protocol"];
}
sendResponse("101 Switching Protocols",headerOut,"");
return true;
}