zoukankan      html  css  js  c++  java
  • RFC 6455-The WebSocket Protocal部分内容

    1. Web的基本数据帧格式:

    WebSocket在建立连接之后,通信的基本数据格式如下图(来源RFC6455-5.2),没有Http请求那么多固定的报文,且不用重复建立连接,所以通信效率高:

    2. Websocket是如何管理连接的?

    RFC6455-5.5给出了答案,协议定义了Control Frame。

    WebSocket的控制帧有:Close、Ping、Pong。其中Close是发起关闭请求;Ping是通信发起方确认链路是否畅通的报文;Pong是通信接收方回应链路是否畅通的报文。

    对应数据帧中的opcode位(Close 0x8, Ping 0x9, Pong 0xA).

    3. Http与Websocket的区别与联系:

    Http与websocket是两个完全不同的协议,都是基于TCP的。两者唯一的联系是WebSocket利用Http进行握手;具体说明请看RFC6455-1.7

    1.7.  Relationship to TCP and HTTP
    
       _This section is non-normative._
    
       The WebSocket Protocol is an independent TCP-based protocol.  Its
       only relationship to HTTP is that its handshake is interpreted by
       HTTP servers as an Upgrade request.
    
       By default, the WebSocket Protocol uses port 80 for regular WebSocket
       connections and port 443 for WebSocket connections tunneled over
       Transport Layer Security (TLS) [RFC2818].
  • 相关阅读:
    通过Internet使用VSS2005
    基于角色的权限设计(一)
    WFF架构及技术
    WFF概述
    企业库:Cache
    权限设计(二)
    应用系统中的编码和编码规则
    希望更多的人也可以来应用wordpress程序
    说说我的一点小感受了
    思维决定命运
  • 原文地址:https://www.cnblogs.com/lfri/p/12589938.html
Copyright © 2011-2022 走看看