意外响应代码 426 [英] Unexpected response code 426

查看:58
本文介绍了意外响应代码 426的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using Tomcat websockets and it is working fine in all browsers except in Safari where it is throwing Unexpected response code 426 error.
I went through web inspector and tried to google it to find solution to this issue.
But did not find any solution to it.
I am using Safari 5.1.7. Any help would be greatly appreciated.
Thanks in Advance

推荐答案

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

The 426 response code on upgrade is appropriate for when your websocket client is not conforming to the WebSocket standard RFC-6455.

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

See Section 4.2.2. Sending the Server's Opening Handshake. 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.

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

What is going on, is that Safari 5.x isn't using the final WebSocket spec, but rather an early experimental draft version, something that tomcat does not correctly support. Few production servers do anymore.

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

For more information see What browsers support HTML5 WebSocket API? and http://caniuse.com/websockets

这篇关于意外响应代码 426的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆