意外响应代码 426

Abh*_*hek 4 javascript safari websocket

我正在使用Tomcat websockets并且它在所有浏览器中都运行良好,除了在 Safari 中它抛出意外响应代码 426 错误。
我浏览了网络检查器并尝试在谷歌上搜索以找到解决此问题的方法。
但是没有找到任何解决办法。
我正在使用 Safari 5.1.7。任何帮助将不胜感激。
提前致谢

Joa*_*elt 5

升级时的 426 响应代码适用于 WebSocket 客户端不符合 WebSocket 标准 RFC-6455 的情况。

见第 4.2.2 节。发送服务器的开始握手。 http://tools.ietf.org/html/rfc6455#section-4.2.2

   /version/
      The |Sec-WebSocket-Version| header field in the client's
      handshake includes the version of the WebSocket Protocol with
      which the client is attempting to communicate.  If this
      version does not match a version understood by the server, the
      server MUST abort the WebSocket handshake described in this
      section and instead send an appropriate HTTP error code (such
      as 426 Upgrade Required) and a |Sec-WebSocket-Version| header
      field indicating the version(s) the server is capable of
      understanding.
Run Code Online (Sandbox Code Playgroud)

发生的事情是,Safari 5.x 没有使用最终的 WebSocket 规范,而是一个早期的实验性草案版本,tomcat 没有正确支持。很少有生产服务器这样做了。

有关更多信息,请参阅哪些浏览器支持 HTML5 WebSocket API?http://caniuse.com/websockets