[]WebSocket的握手失败
请问下,我自己写的C++服务器收到了laya的握手包,我应该返回什么样格式的包给laya客户端?
GET / HTTP/1.1
Host: 192.168.31.2:10002
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: file://
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) LayaAirIDE/1.12.2 Chrome/56.0.2924.87 Electron/1.6.6 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN
Sec-WebSocket-Key: MyHb1IVy4sFNEhTodsPWWw==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
服务器现在返回的握手包是
HTTP/1.1 101 Switching Protocols
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Accept: XO9MT/jm/EzcueKDa0m8xINw9MY=
Sec-WebSocket-Version: 13
但是客户端之后并没有任何返回了。
GET / HTTP/1.1
Host: 192.168.31.2:10002
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: file://
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) LayaAirIDE/1.12.2 Chrome/56.0.2924.87 Electron/1.6.6 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN
Sec-WebSocket-Key: MyHb1IVy4sFNEhTodsPWWw==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
服务器现在返回的握手包是
HTTP/1.1 101 Switching Protocols
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Accept: XO9MT/jm/EzcueKDa0m8xINw9MY=
Sec-WebSocket-Version: 13
但是客户端之后并没有任何返回了。
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Aar0n
赞同来自:
Aar0n
赞同来自:
附上服务器文档一篇https://blog.csdn.net/weixin_3 ... 79894