Supporting Multiple Versions of WebSocket Protocol 支持多版本WebSocket协议
https://tools.ietf.org/html/rfc6455#section-4.4
4.4. Supporting Multiple Versions of WebSocket Protocol
- This section provides some guidance on supporting multiple versions
- of the WebSocket Protocol in clients and servers.
- Using the WebSocket version advertisement capability (the
- |Sec-WebSocket-Version| header field), a client can initially request
- the version of the WebSocket Protocol that it prefers (which doesn't
- necessarily have to be the latest supported by the client). If the
- server supports the requested version and the handshake message is
- otherwise valid, the server will accept that version. If the server
- doesn't support the requested version, it MUST respond with a
- |Sec-WebSocket-Version| header field (or multiple
- |Sec-WebSocket-Version| header fields) containing all versions it is
- willing to use. At this point, if the client supports one of the
- advertised versions, it can repeat the WebSocket handshake using a
- new version value.
- The following example demonstrates version negotiation described
- above:
- GET /chat HTTP/1.1
- Host: server.example.com
- Upgrade: websocket
- Connection: Upgrade
- ...
- Sec-WebSocket-Version: 25
- Fette & Melnikov Standards Track [Page 26]
- RFC 6455 The WebSocket Protocol December 2011
- The response from the server might look as follows:
- HTTP/1.1 400 Bad Request
- ...
- Sec-WebSocket-Version: 13, 8, 7
- Note that the last response from the server might also look like:
- HTTP/1.1 400 Bad Request
- ...
- Sec-WebSocket-Version: 13
- Sec-WebSocket-Version: 8, 7
- The client now repeats the handshake that conforms to version 13:
- GET /chat HTTP/1.1
- Host: server.example.com
- Upgrade: websocket
- Connection: Upgrade
- ...
- Sec-WebSocket-Version: 13
Supporting Multiple Versions of WebSocket Protocol 支持多版本WebSocket协议的更多相关文章
- The WebSocket Protocol
[Docs] [txt|pdf] [draft-ietf-hybi-t...] [Diff1] [Diff2] [Errata] Updated by: 7936 PROPOSED STANDAR ...
- Netty对WebSocket的支持(五)
Netty对WebSocket的支持(五) 一.WebSocket简介 在Http1.0和Http1.1协议中,我们要实现服务端主动的发送消息到网页或者APP上,是比较困难的,尤其是现在IM(即时通信 ...
- Supporting Multiple Screens 翻译 支持各种屏幕(上)
Supporting Multiple Screens 支持各种各样的屏幕尺寸.屏幕密度 Android runs on a variety of devices that offer differe ...
- Tomcat和Jetty对WebSocket的支持
公司项目须要,了解了下眼下几种支持WebSocket的框架.曾经用jWebSocket做过一些项目.相对来说.改jWebSocket的源代码略复杂,也不是一天两天能搞定的. 一调研才发现,如今非常多主 ...
- 让ie6 7 8 9支持原生html5 websocket
让ie6 7 8 9支持原生html5 websocket 从github上的 web-socket-js(socket.io好像也是用这个做的他们的flash替代传输方式)改过来的.不过值得 ...
- 前后端通信—webSocket(支持跨域)
WebSocket 的介绍 WebSocket 是什么 WebSocket 是一种网络通信协议.RFC6455 定义了它的通信标准. WebSocket 是 HTML5 开始提供的一种在单个 TCP ...
- PHPFarm - How to run multiple versions of PHP on the same computer
How to Run Multiple Versions of PHP on One Server 转载:http://www.sitepoint.com/run-multiple-versions- ...
- Hive的Metastore contains multiple versions
hive 客户端报错:Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeExcepti ...
- Spark Sql数仓报-Metastore contains multiple versions
Spark版本为2.1.0,Hadoop版本为2.7.1,元数据存储在mysql中,异常信息如下: Exception in thread "main" java.lang.Run ...
随机推荐
- Android驱动学习-app调用内核驱动过程(驱动框架回顾)
考研已经过去了,android驱动的学习也断了半年多了,现在重新捡起来学习,回顾一下Android驱动的大体框架. Android系统的核心是java,其有一个David虚拟机.Android-app ...
- Qt学习笔记-Qt5和Qt4在音频方面的不同-QtAV
之前学习qt4的时候,播放音频用的是phonon播放后端插件+mplayer. 今天改用qt5了.qt5中去掉了phonon模块加了multimedia.但是依然无法播放音乐,因为没有ffmpge s ...
- LInux学习笔记之常用命令
以下命令主要是平时用到的命令,对于一些经常用到的,就收集资料,归纳一下. 指令目录: 1.yum命令: 2.wget命令: 3.tar命令: 4../configure,make,make insta ...
- 【linux】系统编程-5-线程
目录 前言 7. 线程 7.1 概念 7.2 创建线程 7.2.1 pthread_create() 7.3 设置线程属性 7.3.1 pthread_attr_init() 7.3.2 销毁一个线程 ...
- Beta冲刺——第十天(补发)
这个作业属于哪个课程 https://edu.cnblogs.com/campus/fzzcxy/2018SE1 这个作业要求在哪里 https://edu.cnblogs.com/campus/fz ...
- ES6 对象拓展方法
一,ES6 对象拓展方法 ES6为对象提供了一些拓展方法,下面列举几个比较常见的对象拓展方法.
- CPU性能测试——CoreMark篇
本文将介绍使用CoreMark测试程序对我们小组自研芯片进行性能的测试,记录了CoreMarK工具的使用以及对其测试结果进行分析 测试环境: PC OS: Ubuntu20.04 LTS CPU: 自 ...
- 我的开源项目在五个月内超过了 600 star
其实我在 2016 年年底就开始写了这个项目:Forest,一个能够将 HTTP 的所有请求信息(包括 URL .Header 以及 Body 等信息)绑定到您自定义的 Interface 方法上,能 ...
- 对接口报错404 发现url多了一些不可描述的代码%E2%80%8B
接口url出现了空格,复制的url可能出现空格肉眼看不出来,手动输入一遍URL
- shell脚本学习之6小时搞定(6)-重定向及其他
shell学习之-重定向及其他 目录 shell学习之-重定向及其他 1.输出重定向 2.输入重定向 3.重定向深入讲解 4./dev/null 文件 5.awk Unix 命令默认从标准输入设备(s ...