https://tools.ietf.org/html/rfc6455 https://tools.ietf.org/html/rfc6455

7.4.1. Defined Status Codes

  1.  
  2. Endpoints MAY use the following pre-defined status codes when sending
  3. a Close frame.
  4.  
  5. 1000
  6.  
  7. 1000 indicates a normal closure, meaning that the purpose for
  8. which the connection was established has been fulfilled.
  9.  
  10. 1001
  11.  
  12. 1001 indicates that an endpoint is "going away", such as a server
  13. going down or a browser having navigated away from a page.
  14.  
  15. 1002
  16.  
  17. 1002 indicates that an endpoint is terminating the connection due
  18. to a protocol error.
  19.  
  20. 1003
  21.  
  22. 1003 indicates that an endpoint is terminating the connection
  23. because it has received a type of data it cannot accept (e.g., an
  24. endpoint that understands only text data MAY send this if it
  25. receives a binary message).
  26.  
  27. Fette & Melnikov Standards Track [Page 45]

  1. RFC 6455 The WebSocket Protocol December 2011
  2.  
  3. 1004
  4.  
  5. Reserved. The specific meaning might be defined in the future.
  6.  
  7. 1005
  8.  
  9. 1005 is a reserved value and MUST NOT be set as a status code in a
  10. Close control frame by an endpoint. It is designated for use in
  11. applications expecting a status code to indicate that no status
  12. code was actually present.
  13.  
  14. 1006
  15.  
  16. 1006 is a reserved value and MUST NOT be set as a status code in a
  17. Close control frame by an endpoint. It is designated for use in
  18. applications expecting a status code to indicate that the
  19. connection was closed abnormally, e.g., without sending or
  20. receiving a Close control frame.
  21.  
  22. 1007
  23.  
  24. 1007 indicates that an endpoint is terminating the connection
  25. because it has received data within a message that was not
  26. consistent with the type of the message (e.g., non-UTF-8 [RFC3629]
  27. data within a text message).
  28.  
  29. 1008
  30.  
  31. 1008 indicates that an endpoint is terminating the connection
  32. because it has received a message that violates its policy. This
  33. is a generic status code that can be returned when there is no
  34. other more suitable status code (e.g., 1003 or 1009) or if there
  35. is a need to hide specific details about the policy.
  36.  
  37. 1009
  38.  
  39. 1009 indicates that an endpoint is terminating the connection
  40. because it has received a message that is too big for it to
  41. process.
  42.  
  43. 1010
  44.  
  45. 1010 indicates that an endpoint (client) is terminating the
  46. connection because it has expected the server to negotiate one or
  47. more extension, but the server didn't return them in the response
  48. message of the WebSocket handshake. The list of extensions that
  49.  
  50. Fette & Melnikov Standards Track [Page 46]

  1. RFC 6455 The WebSocket Protocol December 2011
  2.  
  3. are needed SHOULD appear in the /reason/ part of the Close frame.
  4. Note that this status code is not used by the server, because it
  5. can fail the WebSocket handshake instead.
  6.  
  7. 1011
  8.  
  9. 1011 indicates that a server is terminating the connection because
  10. it encountered an unexpected condition that prevented it from
  11. fulfilling the request.
  12.  
  13. 1015
  14.  
  15. 1015 is a reserved value and MUST NOT be set as a status code in a
  16. Close control frame by an endpoint. It is designated for use in
  17. applications expecting a status code to indicate that the
  18. connection was closed due to a failure to perform a TLS handshake
  19. (e.g., the server certificate can't be verified).

7.4.2. Reserved Status Code Ranges

  1.  
  2. 0-999
  3.  
  4. Status codes in the range 0-999 are not used.
  5.  
  6. 1000-2999
  7.  
  8. Status codes in the range 1000-2999 are reserved for definition by
  9. this protocol, its future revisions, and extensions specified in a
  10. permanent and readily available public specification.
  11.  
  12. 3000-3999
  13.  
  14. Status codes in the range 3000-3999 are reserved for use by
  15. libraries, frameworks, and applications. These status codes are
  16. registered directly with IANA. The interpretation of these codes
  17. is undefined by this protocol.
  18.  
  19. 4000-4999
  20.  
  21. Status codes in the range 4000-4999 are reserved for private use
  22. and thus can't be registered. Such codes can be used by prior
  23. agreements between WebSocket applications. The interpretation of
  24. these codes is undefined by this protocol.

The WebSocket Protocol 1000的更多相关文章

  1. The WebSocket Protocol

      [Docs] [txt|pdf] [draft-ietf-hybi-t...] [Diff1] [Diff2] [Errata] Updated by: 7936 PROPOSED STANDAR ...

  2. Supporting Multiple Versions of WebSocket Protocol 支持多版本WebSocket协议

    https://tools.ietf.org/html/rfc6455#section-4.4 4.4. Supporting Multiple Versions of WebSocket Proto ...

  3. RFC-6455 The WebSocket Protocol 浅读

    什么是WebSokcet? WebSocket是一种协议,并且是各大主流浏览器作为客户端支持的协议.它的目标就是用来替代基于 XMLHTTPRequest和长轮询的解决方案.应用在时时弹幕,消息推送, ...

  4. learning websocket protocol

    websocket的产生背景: 众所周知,Web应用的通信过程通常是客户端通过浏览器发出一个请求,服务器端接收请求后进行处理并返回结果给客户端,客户端浏览器将信息呈现.这种机制对于信息变化不是特别频繁 ...

  5. WebSocket - ( 一.概述 )

    说到 WebSocket,不得不提 HTML5,作为近年来Web技术领域最大的改进与变化,包含CSS3.离线与存储.多媒体.连接性( Connectivity )等一系列领域,而即将介绍的 WebSo ...

  6. Websocket 协议解析

    WebSocket protocol 是HTML5一种新的协议.它是实现了浏览器与服务器全双工通信(full-duplex).          现 很多网站为了实现即时通讯,所用的技术都是轮询(po ...

  7. 【转】Spring websocket 使用

    http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html https://spr ...

  8. Websocket 与代理服务器如何交互? How HTML5 Web Sockets Interact With Proxy Servers

    How HTML5 Web Sockets Interact With Proxy Servers Posted by Peter Lubberson Mar 16, 2010 With the re ...

  9. Practical Node.js (2018版) 第9章: 使用WebSocket建立实时程序,原生的WebSocket使用介绍,Socket.IO的基本使用介绍。

    Real-Time Apps with WebSocket, Socket.IO, and DerbyJS 实时程序的使用变得越来越广泛,如传统的交易,游戏,社交,开发工具DevOps tools, ...

随机推荐

  1. 唐诗宋词APP

    古诗词个人爱好,已收集5万多首唐诗以及1万多首宋词,因时间有限目前只开发了苹果版,后期开发安卓版, <风月醉>一 国学经典,有兴趣的可以下载学习古诗词,有问题可以留言哦! https:// ...

  2. Java学习_Java核心类

    字符串和编码 字符串在String内部是通过一个char[]数组表示的,因此,可以按下面的写法: String s2 = new String(new char[] {'H', 'e', 'l', ' ...

  3. SpringBoot 内嵌容器的比较

    Spring Boot内嵌容器支持Tomcat.Jetty.Undertow.为什么选择Undertow? 这里有一篇文章,时间 2017年1月26日发布的: 参考 Tomcat vs. Jetty ...

  4. 微信支付(PC扫码支付和H5公众号支付)

    最近在做微信支付,微信支付比较坑,官方居然只有.NET.C#.PHP的demo居然没有java的demo.然后微信支付是不提供测试账号的需要直接用正式的公众号.首先来介绍下微信扫码支付吧,微信扫码有两 ...

  5. 开源编解码项目FFmpeg迎来20周年生日 凭一己之力养活全球无数播放器!

    近日,开源编解码库项目FFmpeg迎来20周年生日. 2000.12.20-2020.12.20 可能很多人对于FFmpeg不是特别了解,那么以下几个名字是否大家或多或少都用过呢? 暴风影音.PotP ...

  6. 学习 Gin 总结(2020.12.30-31)

    2020.12.30 问题总结 中间件 context.Next() 源码注释: // Next should be used only inside middleware. // It execut ...

  7. python实例:解决经典扑克牌游戏 -- 四张牌凑24点 (一)

    Hey! Hope you had a great day so far! 今天想和大家讨论的是一道我从这学期cs的期末考试得到灵感的题:Get 24 Poker Game.说到 Get 24 Pok ...

  8. Spring Cloud Config原码篇(十)

    上篇中说到通过@Value注解获取配置中心的内容进行注入,要想了解这个就要知道spring Environment原理,关于这原理我看了下网上分析的文章:https://blog.csdn.net/t ...

  9. python之scrapy框架基础搭建

    一.创建工程 #在命令行输入scrapy startproject xxx #创建项目 二.写item文件 #写需要爬取的字段名称 name = scrapy.Field() #例 三.进入spide ...

  10. 异步技巧之CompletableFuture

    摘自--https://juejin.im/post/5b4622df5188251ac9766f47 异步技巧之CompletableFuture 1.Future接口 1.1 什么是Future? ...