简体   繁体   English

WebSocket协议的状态如何?

[英]What's the status of WebSocket protocol?

I see a section called IANA Considerations in the RFC 6455 - Web Socket Protocol . 我在RFC 6455-Web套接字协议中看到名为IANA注意事项的部分。

It defines several HTTP headers to be added to HTTP protocol. 它定义了几个要添加到HTTP协议的HTTP标头。 Such as Sec-WebSocket-Key , Sec-WebSocket-Extensions , etc. 例如Sec-WebSocket-KeySec-WebSocket-Extensions等。

But I didn't find these headers in the RFC 2616 - HTTP 1.1 Protocol . 但是我在RFC 2616-HTTP 1.1协议中找不到这些标头。

So are these headers definitions ready for use? 那么这些标头定义可以使用了吗?

(I am not quite familiar with how RFC documents are organized. So pardon me this is a dumb question.) (我不太熟悉RFC文档的组织方式。所以请原谅这是一个愚蠢的问题。)

The HTTP protocol allows for custom headers to be added to any HTTP request. HTTP协议允许将自定义标头添加到任何HTTP请求中。 If the HTTP server doesn't know about a particular header name, it just ignores it. 如果HTTP服务器不知道特定的标头名称,则将其忽略。 The initiation of a webSocket connection adds some custom headers to its HTTP request that are not standard HTTP-defined header names, but they are formatted as standard HTTP headers (as defined in section 4.2 of RFC 2616) and thus are safely ignored by any HTTP server that doesn't understand them. webSocket连接的启动将一些自定义标头添加到其HTTP请求中,这些标头不是标准的HTTP定义的标头名称,但是它们被格式化为标准的HTTP标头(如RFC 2616的4.2节中所定义),因此任何HTTP都可以安全地忽略它们不了解它们的服务器。

As Julian pointed out in comments, you can see the Sec-WebSocket-xxx headers registered here in the IANA header registry and you may have already seen, the meaning of those headers are described in more detail in RFC 6455 . 正如朱利安(Julian)在评论中指出的那样,您可以在IANA标头注册表中看到此处注册的Sec-WebSocket-xxx标头,并且您可能已经看到,这些标头的含义在RFC 6455中进行了更详细的描述。

Furthermore, section 8.3 of RFC 7231 describes the general process for defining and registering new headers and the rules that they should follow (and other specifications that help define those rules). 此外, RFC 7231的8.3节介绍了定义和注册新标头的一般过程以及应遵循的规则(以及有助于定义这些规则的其他规范)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM