lixuancn/MeepoPS

Sec-WebSocket-Version can not be less than 13

lbsfei opened this issue · 2 comments

使用ThinkPHP集成MeepoPS时,在浏览器出现这个提示,怎么处理?
环境:
ThinkPHP V3.2.3
CentOS 7
PHP 5.4.16

我说websocket版本不能低于13。MeepoPS在服务端使用的websocket版本是13,你要去检查一下客户端是什么版本,另外浏览器是什么浏览器。

JS的new WebSocket('ws://localhost:8080');是H5的特性。

你可以使用最新版的Chrome的检查-Console中输入new WebSocket('ws://localhost:8080');来测试是不是服务端的问题。

如有反馈,请及时联系。谢谢

在MeepoPS是这么定义的:

//WebSocket版本不能低于13
if(empty($_SERVER['Sec-WebSocket-Version']) || $_SERVER['Sec-WebSocket-Version'] < 13){
    $connect->send("HTTP/1.1 400 Bad Request\r\n\r\nSec-WebSocket-Version can not be less than 13", true);
    self::_disConnect($connect);
    return;
}