RFC 6455 - The WebSocket Protocol https://tools.ietf.org/html/rfc6455

1.5. Design Philosophy


   _This section is non-normative._

   The WebSocket Protocol is designed on the principle that there should
be minimal framing (the only framing that exists is to make the
protocol frame-based instead of stream-based and to support a
distinction between Unicode text and binary frames). It is expected
that metadata would be layered on top of WebSocket by the application Fette & Melnikov Standards Track [Page 9]

RFC 6455                 The WebSocket Protocol            December 2011

   layer, in the same way that metadata is layered on top of TCP by the
application layer (e.g., HTTP). Conceptually, WebSocket is really just a layer on top of TCP that
does the following: o adds a web origin-based security model for browsers o adds an addressing and protocol naming mechanism to support
multiple services on one port and multiple host names on one IP
address o layers a framing mechanism on top of TCP to get back to the IP
packet mechanism that TCP is built on, but without length limits o includes an additional closing handshake in-band that is designed
to work in the presence of proxies and other intermediaries Other than that, WebSocket adds nothing. Basically it is intended to
be as close to just exposing raw TCP to script as possible given the
constraints of the Web. It's also designed in such a way that its
servers can share a port with HTTP servers, by having its handshake
be a valid HTTP Upgrade request. One could conceptually use other
protocols to establish client-server messaging, but the intent of
WebSockets is to provide a relatively simple protocol that can
coexist with HTTP and deployed HTTP infrastructure (such as proxies)
and that is as close to TCP as is safe for use with such
infrastructure given security considerations, with targeted additions
to simplify usage and keep simple things simple (such as the addition
of message semantics). The protocol is intended to be extensible; future versions will
likely introduce additional concepts such as multiplexing.

https://github.com/HJava/myBlog

【译】WebSocket协议第一章——介绍(Introduction) - 掘金 https://juejin.im/post/5b1a7189e51d45068b496cf0

WebSocket TCP HTTP的更多相关文章

  1. Nginx 解决WebSocket TCP 转发问题

    背景:   IM 即时通讯时候  , 前期我用的是IP 没什么问题,当然上线肯定要搞个域名搞搞了! 那么问题来了------>Nginx  我按照原先那样配置时候不行了, 连接不了. 解决方法: ...

  2. Nginx 不支持WebSocket TCP

    proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";

  3. TCP连接建立与释放

    tcp建立连接 tcp连接的建立需要经历”三次握手“的过程.过程如下 client发送SYN包(值为j)以及SEQ包到server端,此时client进入SYN_SEND状态.此为第一次握手. ser ...

  4. doubango简介

    1.doubango官网:http://www.doubango.org/ doubango常用项目国内镜像(放在淘宝的svn服务器),目前有4个项目:doubango, idoubs, imsdro ...

  5. doubango介绍

    1.doubango官网:http://www.doubango.org/ 2.doubango是一个开源的VOIP基础平台, 并能用于嵌入式和桌面系统的开源框架,该框架使用ANSCI-C编写,具有很 ...

  6. 【分享】2017 开源中国新增开源项目排行榜 TOP 100

    2017 年开源中国社区新增开源项目排行榜 TOP 100 新鲜出炉! 这份榜单根据 2017 年开源中国社区新收录的开源项目的关注度和活跃度整理而来,这份最受关注的 100 款开源项目榜单在一定程度 ...

  7. Erlang cowboy 入门参考

    Erlang cowboy 入门参考 cheungmine,2014-10-28 本文翻译自: http://ninenines.eu/docs/en/cowboy/HEAD/guide/gettin ...

  8. Istio究竟是干嘛的?

    要聊ServiceMesh,就不得不提Istio,它是ServiceMesh目前最流行的实践, 当微服务架构体系越来越复杂的时候,需要将“业务服务”和“基础设施”解耦,将一个微服务进程一分为二: 一个 ...

  9. 使用 WebSockets 技术的 9 个应用场景

    没有其他技术能够像WebSocket一样提供真正的双向通信,许多web开发者仍然是依赖于ajax的长轮询来实现.对Websocket缺少热情,也许是因为多年前他的安全性的脆弱,抑或者是缺少浏览器的支持 ...

随机推荐

  1. 写一个nginx.conf方便用于下载某个网页的所有资源

    写一个nginx.conf方便用于下载某个网页的所有资源 worker_processes 1; events { worker_connections 1024; } http { include ...

  2. Windows锁定屏幕然后关闭显示器,可执行程序

    有时候我们需要关闭屏幕来休息一下或者在本上写东西,但是屏幕亮着的时候会分心,但是关闭显示器又太麻烦了,所以直接来一个小程序(非微信小程序).还有一种情况,有时候晚上要离开电脑旁了,但是电脑还在做事情, ...

  3. Dubbo服务调用过程源码解析④

    目录 0.服务的调用 1.发送请求 2.请求编码 3.请求的解码 4.调用具体服务 5.返回调用结果 6.接收调用结果 Dubbo SPI源码解析① Dubbo服务暴露源码解析② Dubbo服务引用源 ...

  4. git使用下

    Git 内部工作原理 Git 本质上是一个内容寻址文件系统,最初是一套面向版本控制系统的工具集,而不是一个完整的用户友好的版本控制系统.因此它还包含了一些用于完成底层工作的命令,这些命令被称为&quo ...

  5. 看完这篇,保证让你真正明白:分布式系统的CAP理论、CAP如何三选二

    引言 CAP 理论,相信很多人都听过,它是指: 一个分布式系统最多只能同时满足一致性(Consistency).可用性(Availability)和分区容错性(Partition tolerance) ...

  6. leetcode上面用刷题不要使用static静态变量

    因为leetcode上面每个测试用例会使用之前的同一个类,使用静态变量会导致静态变量的值不被初始话从而使得本次测试用例,之前的静态变量,从而导致错误发生.

  7. Mac电脑 Android Studio连接小米手机

    1.设置>关于本机>点击5下MIUI版本>激活开发者模式 2.设置>更多设置>开发者选项>开启开发者选项>开启USB调试>开启USB安装>开启显示 ...

  8. GC算法与回收策略

    算法: 标记-清理  :首先标记出需要回收的对象 ,然后统一回收待标记的对象. 缺点:易产生大量空间碎片,空间碎片太多导致程序在运行过程中产生大对象时 因为空间不足导致容易导致另一个垃圾收集动作 标记 ...

  9. U盘容量变小处理

    参考: https://blog.csdn.net/weixin_39792252/article/details/80676300?utm_medium=distribute.pc_relevant ...

  10. Nexus3.X在linux系统搭建maven私服

    准备工作: 1.linux服务器上需安装jdk(非yum下来的open_jdk!!!,版本1.8以上) 2.linux服务器上需安装maven(如不会,请点击链接,maven版本自己喜欢就好) 准备工 ...