最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Unexpected response code 426 - Stack Overflow

programmeradmin3浏览0评论

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

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

Share Improve this question asked Dec 14, 2013 at 13:07 AbhishekAbhishek 2,0198 gold badges29 silver badges53 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

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

See Section 4.2.2. Sending the Server's Opening Handshake. https://www.rfc-editor/rfc/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 municate.  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.

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.

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

发布评论

评论列表(0)

  1. 暂无评论