RFC 6455
The WebSocket Protocol December 2011
7.1.6. The WebSocket Connection Close Reason . . . . . . . . 43
7.1.7. Fail the WebSocket Connection . . . . . . . . . . . . 43
7.2. Abnormal Closures . . . . . . . . . . . . . . . . . . . . 44
7.2.1. Client-Initiated Closure . . . . . . . . . . . . . . . 44
7.2.2. Server-Initiated Closure . . . . . . . . . . . . . . . 44
7.2.3. Recovering from Abnormal Closure . . . . . . . . . . . 44
7.3. Normal Closure of Connections . . . . . . . . . . . . . . 45
7.4. Status Codes . . . . . . . . . . . . . . . . . . . . . . . 45
7.4.1. Defined Status Codes . . . . . . . . . . . . . . . . . 45
7.4.2. Reserved Status Code Ranges . . . . . . . . . . . . . 47
8. Error Handling . . . . . . . . . . . . . . . . . . . . . . . . 48
8.1. Handling Errors in UTF-8-Encoded Data . . . . . . . . . . 48
9. Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.1. Negotiating Extensions . . . . . . . . . . . . . . . . . . 48
9.2. Known Extensions . . . . . . . . . . . . . . . . . . . . . 50
10. Security Considerations . . . . . . . . . . . . . . . . . . . 50
10.1. Non-Browser Clients . . . . . . . . . . . . . . . . . . . 50
10.2. Origin Considerations . . . . . . . . . . . . . . . . . . 50
10.3. Attacks On Infrastructure (Masking) . . . . . . . . . . . 51
10.4. Implementation-Specific Limits . . . . . . . . . . . . . . 52
10.5. WebSocket Client Authentication . . . . . . . . . . . . . 53
10.6. Connection Confidentiality and Integrity . . . . . . . . . 53
10.7. Handling of Invalid Data . . . . . . . . . . . . . . . . . 53
10.8. Use of SHA-1 by the WebSocket Handshake . . . . . . . . . 54
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 54
11.1. Registration of New URI Schemes . . . . . . . . . . . . . 54
11.1.1. Registration of "ws" Scheme . . . . . . . . . . . . . 54
11.1.2. Registration of "wss" Scheme . . . . . . . . . . . . . 55
11.2. Registration of the "WebSocket" HTTP Upgrade Keyword . . . 56
11.3. Registration of New HTTP Header Fields . . . . . . . . . . 57
11.3.1. Sec-WebSocket-Key . . . . . . . . . . . . . . . . . . 57
11.3.2. Sec-WebSocket-Extensions . . . . . . . . . . . . . . . 58
11.3.3. Sec-WebSocket-Accept . . . . . . . . . . . . . . . . . 58
11.3.4. Sec-WebSocket-Protocol . . . . . . . . . . . . . . . . 59
11.3.5. Sec-WebSocket-Version . . . . . . . . . . . . . . . . 60
11.4. WebSocket Extension Name Registry . . . . . . . . . . . . 61
11.5. WebSocket Subprotocol Name Registry . . . . . . . . . . . 61
11.6. WebSocket Version Number Registry . . . . . . . . . . . . 62
11.7. WebSocket Close Code Number Registry . . . . . . . . . . . 64
11.8. WebSocket Opcode Registry . . . . . . . . . . . . . . . . 65
11.9. WebSocket Framing Header Bits Registry . . . . . . . . . . 66
12. Using the WebSocket Protocol from Other Specifications . . . . 66
13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 67
14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 68
14.1. Normative References . . . . . . . . . . . . . . . . . . . 68
14.2. Informative References . . . . . . . . . . . . . . . . . . 69
Fette & Melnikov Standards Track [Page 3]