idnits 2.17.1 draft-ietf-hybi-permessage-compression-26.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 6, 2015) is 3187 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 1951 -- Possible downref: Non-RFC (?) normative reference: ref. 'LZ77' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HyBi Working Group T. Yoshino 3 Internet-Draft Google, Inc. 4 Intended status: Standards Track August 6, 2015 5 Expires: February 7, 2016 7 Compression Extensions for WebSocket 8 draft-ietf-hybi-permessage-compression-26 10 Abstract 12 This document defines a framework for creating WebSocket extensions 13 that add compression functionality to the WebSocket Protocol. An 14 extension based on this framework compresses the payload data portion 15 of WebSocket data messages on a per-message basis using parameters 16 negotiated during the opening handshake. This framework provides a 17 general method for applying a compression algorithm to the contents 18 of WebSocket messages. Each compression algorithm has to be defined 19 in a document defining the extension by specifying parameter 20 negotiation and payload transformation algorithm in detail. This 21 document also specifies one specific compression extension using the 22 DEFLATE algorithm. 24 Please send feedback to the hybi@ietf.org mailing list. 26 Status of this Memo 28 This Internet-Draft is submitted to IETF in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on February 7, 2016. 43 Copyright Notice 45 Copyright (c) 2015 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Conformance Requirements and Terminology . . . . . . . . . . . 4 62 3. Complementary Terminology . . . . . . . . . . . . . . . . . . 5 63 4. WebSocket Per-message Compression Extension . . . . . . . . . 6 64 5. Extension Negotiation . . . . . . . . . . . . . . . . . . . . 7 65 5.1. General Negotiation Flow . . . . . . . . . . . . . . . . . 9 66 5.2. Negotiation Examples . . . . . . . . . . . . . . . . . . . 10 67 6. Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 68 6.1. Compression . . . . . . . . . . . . . . . . . . . . . . . 12 69 6.2. Decompression . . . . . . . . . . . . . . . . . . . . . . 13 70 7. The permessage-deflate extension . . . . . . . . . . . . . . . 15 71 7.1. Extension Parameters . . . . . . . . . . . . . . . . . . . 16 72 7.1.1. Context Takeover Control . . . . . . . . . . . . . . . 16 73 7.1.2. Limiting the LZ77 sliding window size . . . . . . . . 18 74 7.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 20 75 7.2. Message Payload Transformation . . . . . . . . . . . . . . 21 76 7.2.1. Compression . . . . . . . . . . . . . . . . . . . . . 21 77 7.2.2. Decompression . . . . . . . . . . . . . . . . . . . . 22 78 7.2.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 23 79 7.3. Implementation Notes . . . . . . . . . . . . . . . . . . . 27 80 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28 81 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 82 9.1. Registration of the "permessage-deflate" WebSocket 83 Extension Name . . . . . . . . . . . . . . . . . . . . . . 29 84 9.2. Registration of the "Per-message Compressed" WebSocket 85 Framing Header Bit . . . . . . . . . . . . . . . . . . . . 29 86 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 87 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 88 11.1. Normative References . . . . . . . . . . . . . . . . . . . 31 89 11.2. Informative References . . . . . . . . . . . . . . . . . . 31 90 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 32 92 1. Introduction 94 This document specifies a framework for adding compression 95 functionality to the WebSocket Protocol [RFC6455]. The framework 96 specifies how to define WebSocket Per-message Compression Extensions 97 (PMCEs) for a compression algorithm based on the extension concept of 98 the WebSocket Protocol specified in Section 9 of [RFC6455]. A 99 WebSocket client and a peer WebSocket server negotiate the use of a 100 PMCE and determine the parameters required to configure the 101 compression algorithm during the WebSocket opening handshake. The 102 client and server can then exchange data messages whose frames 103 contain compressed data in the payload data portion. 105 This framework only specifies a general method for applying a 106 compression algorithm to the contents of WebSocket messages. Each 107 individual PMCE has to be specified in a document describing in 108 detail how to negotiate the configuration parameters for the specific 109 compression algorithm used by that PMCE and how to transform 110 (compress and decompress) data in the payload data portion. 112 A WebSocket client may offer multiple PMCEs during the WebSocket 113 opening handshake. A peer WebSocket server receiving the offer may 114 choose to accept the preferred PMCE or decline all of them. PMCEs 115 use the RSV1 bit of the WebSocket frame header to indicate whether a 116 message is compressed or not, so that an endpoint can choose not to 117 compress messages with incompressible contents. 119 This document also specifies one specific PMCE based on the DEFLATE 120 [RFC1951] algorithm. The DEFLATE algorithm is widely available on 121 various platforms and its overhead is small. The extension name of 122 this PMCE is "permessage-deflate". To align the end of compressed 123 data to an octet boundary, this extension uses the algorithm 124 described in Section 2.1 of [RFC1979]. Endpoints can take over the 125 LZ77 sliding window [LZ77] used to build frames for previous messages 126 to achieve a better compression ratio. For resource-limited devices, 127 this extension provides parameters to limit memory usage for 128 compression context. 130 2. Conformance Requirements and Terminology 132 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 133 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 134 document are to be interpreted as described in [RFC2119]. 136 Requirements phrased in the imperative as part of algorithms (such as 137 "strip any leading space characters" or "return false and abort these 138 steps") are to be interpreted with the meaning of the key word 139 ("MUST", "SHOULD", "MAY", etc.) used in introducing the algorithm. 141 Conformance requirements phrased as algorithms or specific steps can 142 be implemented in any manner, so long as the end result is 143 equivalent. In particular, the algorithms defined in this 144 specification are intended to be easy to understand and are not 145 intended to be performant. 147 This document references the procedure to _Fail the WebSocket 148 Connection_. This procedure is defined in Section 7.1.7 of 149 [RFC6455]. 151 This document references the event that _The WebSocket Connection is 152 Established_ and the event that _A WebSocket Message Has Been 153 Received_. These events are defined in Section 4.1 and Section 6.2, 154 respectively, of [RFC6455]. 156 This document uses the Augmented Backus-Naur Form (ABNF) notation of 157 [RFC5234]. The DIGIT (decimal 0-9) rule is included by reference, as 158 defined in the Appendix B.1 of [RFC5234]. 160 3. Complementary Terminology 162 This document defines some terms about WebSocket and WebSocket 163 Extension mechanisms that are underspecified or not defined at all in 164 [RFC6455]. This terminology is effective only in this document and 165 any other documents explicitly referring to this section. 167 "A data message" means a message consisting of Data Frames as defined 168 in Section 5.6 of [RFC6455]. 170 "A message payload (or payload of a message)" means the concatenation 171 of the payload data portion of all Data Frames (see Section 6.2 of 172 [RFC6455]) representing a single message. 174 "An extension in use next to extension X" means the extension listed 175 next to X in the "Sec-WebSocket-Extensions" header in the server's 176 opening handshake as defined in Section 9.1 of [RFC6455]. Such an 177 extension is applied to outgoing data from the application right 178 after X on the sender side, but applied right before X to incoming 179 data from the underlying transport. 181 "An extension in use preceding extension X" means the extension 182 listed right before X in the "Sec-WebSocket-Extensions" header in the 183 server's opening handshake. Such an extension is applied to outgoing 184 data from the application right before X on the sender side, but 185 applied right after X to incoming data from the underlying transport. 187 "An extension negotiation offer" means each element in the 188 "Sec-WebSocket-Extensions" header in the client's opening handshake. 190 "An extension negotiation response" means each element in the 191 "Sec-WebSocket-Extensions" header in the server's opening handshake. 193 "A corresponding extension negotiation response for an extension 194 negotiation offer" means an extension negotiation response that a 195 server sends back to the peer client containing the same extension 196 name as the offer and meeting the requirements represented by the 197 offer. 199 "Accepting an extension negotiation offer" means including a 200 corresponding extension negotiation response for the offer in the 201 "Sec-WebSocket-Extensions" header in the server's opening handshake. 203 "Declining an extension negotiation offer" means not including a 204 corresponding extension negotiation response for the offer in the 205 "Sec-WebSocket-Extensions" header in the server's opening handshake. 207 4. WebSocket Per-message Compression Extension 209 WebSocket Per-message Compression Extensions (PMCEs) are extensions 210 to the WebSocket Protocol enabling compression functionality. PMCEs 211 are built based on the extension concept of the WebSocket Protocol 212 specified in Section 9 of [RFC6455]. PMCEs are individually defined 213 for each compression algorithm to be implemented, and are registered 214 in the WebSocket Extension Name Registry created in Section 11.4 of 215 [RFC6455]. Each PMCE referring to this framework MUST define the 216 following: 218 o The extension name of the PMCE and any applicable extension 219 parameters that MUST be included in the "Sec-WebSocket-Extensions" 220 header during the extension negotiation offer/response. 222 o How to interpret the extension parameters exchanged during the 223 opening handshake. 225 o How to transform the payload of a message. 227 One PMCE is defined in Section 7 of this document and is registered 228 in Section 9. Other PMCEs may be defined in the future in other 229 documents. 231 Section 5 describes the basic extension negotiation process. 232 Section 6 describes how to apply the compression algorithm with 233 negotiated parameters to the contents of WebSocket messages. 235 5. Extension Negotiation 237 To offer use of a PMCE, a client MUST include the extension name of 238 the PMCE in the "Sec-WebSocket-Extensions" header field of its 239 opening handshake of the WebSocket connection. Extension parameters 240 are used to specify the PMCE offer in detail. For example, a client 241 lists its preferred configuration parameter values for the 242 compression algorithm of the PMCE. A client may also offer multiple 243 PMCE choices to the server by including multiple elements in the 244 "Sec-WebSocket-Extensions" header, one for each PMCE offered. This 245 set of elements MAY include multiple PMCEs with the same extension 246 name to offer the possibility to use the same algorithm with 247 different configuration parameters. The order of elements is 248 important as it specifies the client's preference. An element 249 preceding another element has higher preference. It is recommended 250 that a server accepts PMCEs with higher preference if the server 251 supports them. 253 A PMCE negotiation offer provides requests and/or hints to the 254 server. 256 A request in a PMCE negotiation offer indicates constraints on the 257 server's behavior that must be satisfied if the server accepts the 258 offer. For example, suppose that a server sends data compressed with 259 the DEFLATE algorithm to a client. The server must keep the original 260 bytes of data that it recently compressed and sent to the client. 261 The client must keep the result of decompressing the bytes of data 262 that it recently received from the server. The amount of bytes of 263 data kept is called the LZ77 window size. The LZ77 window size of 264 the client must not be less than the LZ77 window size of the server. 265 In a PMCE negotiation offer, the client MUST inform the server of its 266 LZ77 window size so that the server uses an LZ77 window size that is 267 not greater than the LZ77 window size of the client. This 268 restriction on the LZ77 window size is an example of a request in a 269 PMCE negotiation offer. 271 A hint in a PMCE negotiation offer provides information about the 272 client's behavior that the server may either safely ignore or refer 273 to when the server decides its behavior. For example, suppose that a 274 client sends data compressed with the DEFLATE algorithm to a server. 275 The client must keep the original bytes of data that it recently 276 compressed and sent to the server. The server must keep the result 277 of decompressing the bytes of data that it recently received from the 278 client. The LZ77 window size of the server must not be less than the 279 LZ77 window size of the client. In a PMCE negotiation offer, the 280 client MAY inform the maximum LZ77 window size the client can afford 281 so that the server can choose to use an LZ77 window size that is not 282 greater than the maximum size of the client. This information is an 283 example of a hint in a PMCE negotiation offer. It's waste of memory 284 to use an LZ77 window size greater than the LZ77 window size the 285 client actually uses. Using the hint, the server can avoid the waste 286 of memory. Since the hint itself doesn't specify the constraints on 287 the endpoints, the server must use the "agreed parameters" (defined 288 below) to explicitly ask the client not to use an LZ77 window size 289 greater than the LZ77 window size of the server. 291 To accept the use of an offered PMCE, a server MUST include the 292 extension name of the PMCE in the "Sec-WebSocket-Extensions" header 293 field of its opening handshake of the WebSocket connection. 294 Extension parameters represent the detailed configuration parameters 295 of the PMCE to use. These extension parameters and their values are 296 called "agreed parameters". The element MUST represent a PMCE that 297 is fully supported by the server. The contents of the element don't 298 need to be exactly the same as those of the received extension 299 negotiation offers. For example, suppose that a server received a 300 PMCE extension negotiation offer with an extension parameter "X" 301 indicating that the client can enable an optional feature named X. 302 The server may accept the PMCE offer with an element without the 303 extension parameter "X" meaning that the server chose not to enable 304 the feature X. In this case, the offer contains the extension 305 parameter "X" but the "agreed parameters" don't contain the extension 306 parameter "X". 308 "Agreed parameters" MUST represent how the requests and hints in the 309 client's extension negotiation offer have been handled in addition to 310 the server's requests and hints on the client's behavior, so that the 311 client can configure its behavior without identifying exactly which 312 PMCE extension negotiation offer has been accepted. 314 For example, if a client sends an extension negotiation offer that 315 includes a parameter "enable_compression" and another without this 316 parameter, the server accepts the former and informs the client by 317 sending back an element that includes parameter(s) acknowledging 318 "enable_compression". The name of the acknowledging parameter 319 doesn't need to be exactly the same as the offer. For example, two 320 parameters "enable_strong_compression" and "enable_weak_compression" 321 may be defined as acknowledging parameters for "enable_compression". 323 Compression features can be applied differently for each direction. 324 For such features, the acknowledging parameter and the parameter in 325 the reverse direction must be chosen to distinguish them. For 326 example, in order to make parameters distinguishable, a "server_" 327 prefix can be added to parameters affecting data sent from a server 328 and a "client_" prefix can be added to parameters affecting data sent 329 from a client. 331 A server MUST NOT accept a PMCE extension negotiation offer together 332 with another extension if the PMCE will conflict with the extension 333 on their use of the RSV1 bit. A client that received a response 334 accepting a PMCE extension negotiation offer together with such an 335 extension MUST _Fail the WebSocket Connection_. 337 A server MUST NOT accept a PMCE extension negotiation offer together 338 with another extension if the PMCE will be applied to the output of 339 the extension and any of the following conditions applies to the 340 extension: 342 o The extension requires the boundary of frames to be preserved 343 between the output from the extension at the sender and the input 344 to the extension at the receiver. 346 o The extension uses the "Extension data" field or any of the 347 reserved bits on the WebSocket header as a per-frame attribute. 349 A client that receives a response accepting a PMCE extension 350 negotiation offer together with such an extension MUST _Fail the 351 WebSocket Connection_. 353 A server declining all offered PMCEs MUST NOT include any element 354 with PMCE names. If a server responds with no PMCE element in the 355 "Sec-WebSocket-Extensions" header, both endpoints proceed without 356 Per-message Compression once _the WebSocket Connection is 357 established_. 359 If a server gives an invalid response, such as accepting a PMCE that 360 the client did not offer, the client MUST _Fail the WebSocket 361 Connection_. 363 If a server responds with a valid PMCE element in the 364 "Sec-WebSocket-Extensions" header and _the WebSocket Connection is 365 established_, both endpoints MUST use the algorithm described in 366 Section 6 and the message payload transformation (compressing and 367 decompressing) procedure of the PMCE configured with the "agreed 368 parameters" returned by the server to exchange messages. 370 5.1. General Negotiation Flow 372 This section describes a general negotiation flow. How to handle 373 parameters in detail must be specified in the document specifying the 374 PMCE. 376 A client makes an offer including parameters identifying the 377 following: 379 o Hints about how the client is planning to compress data 381 o Requests about how the server compresses data 383 o Limitations concerning the client's compression functionality 385 The peer server makes a determination of its behavior based on these 386 parameters. If the server can and wants to proceed with this PMCE 387 enabled, the server responds to the client with parameters 388 identifying the following: 390 o Requests about how the client compresses data 392 o How the server will compress data 394 Based on these parameters received from the server, the client 395 determines its behavior and if it can and wants to proceed with this 396 PMCE enabled. Otherwise, the client starts closing handshake with 397 close code 1010. 399 5.2. Negotiation Examples 401 The following are example values for the "Sec-WebSocket-Extensions" 402 header offering PMCEs. permessage-foo and permessage-bar in the 403 examples are hypothetical extension names of PMCEs for compression 404 algorithm foo and bar. 406 o Offer the permessage-foo. 408 permessage-foo 410 o Offer the permessage-foo with a parameter x with a value of 10. 412 permessage-foo; x=10 414 The value MAY be quoted. 416 permessage-foo; x="10" 418 o Offer the permessage-foo as first choice and the permessage-bar as 419 a fallback plan. 421 permessage-foo, permessage-bar 423 o Offer the permessage-foo with a parameter use_y which enables a 424 feature y as first choice, and the permessage-foo without the 425 use_y parameter as a fallback plan. 427 permessage-foo; use_y, permessage-foo 429 6. Framing 431 PMCEs operate only on data messages. 433 This document allocates the RSV1 bit of the WebSocket header for 434 PMCEs, and calls the bit the "Per-message Compressed" bit. On a 435 WebSocket connection where a PMCE is in use, this bit indicates 436 whether a message is compressed or not. 438 A message with the "Per-message Compressed" bit set on the first 439 fragment of the message is called a "compressed message". Frames of 440 a compressed message have compressed data in the payload data 441 portion. An endpoint receiving a compressed message decompresses the 442 concatenation of the compressed data of the frames of the message by 443 following the decompression procedure specified by the PMCE in use. 444 The endpoint uses the bytes corresponding to the application data 445 portion in this decompressed data for the _A WebSocket Message Has 446 Been Received_ event instead of the received data as-is. 448 A message with the "Per-message Compressed" bit unset on the first 449 fragment of the message is called an "uncompressed message". Frames 450 of an uncompressed message have uncompressed original data as-is in 451 the payload data portion. An endpoint receiving an uncompressed 452 message uses the concatenation of the application data portion of the 453 frames of the message as-is for the _A WebSocket Message Has Been 454 Received_ event. 456 6.1. Compression 458 An endpoint MUST use the following algorithm to send a message in the 459 form of a compressed message. 461 1. Compress the message payload of the original message by following 462 the compression procedure of the PMCE. The original message may 463 be input from the application layer or output of another 464 WebSocket extension depending on which extensions were 465 negotiated. 467 2. Process the compressed data as follows: 469 * If this PMCE is the last extension to process of outgoing 470 messages, build frame(s) by using the compressed data instead 471 of the original data for the message payload, and set the 472 "Per-message Compressed" bit of the first frame, then send the 473 frame(s) as described in Section 6.1 of RFC6455. 475 * Otherwise, pass the transformed message payload and modified 476 header values including the "Per-message Compressed" bit value 477 set to 1 to the extension next to the PMCE. If the extension 478 expects frames for input, build a frame for the message and 479 pass it. 481 An endpoint MUST use the following algorithm to send a message in the 482 form of an uncompressed message. 484 1. Process the original data as follows: 486 * If this PMCE is the last extension to process of outgoing 487 messages, build frame(s) by using the original data for the 488 payload data portion as-is and unset the "Per-message 489 Compressed" bit of the first frame, then send the frame(s) as 490 described in Section 6.1 of RFC6455. 492 * Otherwise, pass the message payload and header values to the 493 extension next to the PMCE as-is. If the extension expects 494 frames for input, build a frame for the message and pass it. 496 An endpoint MUST NOT set the "Per-message Compressed" bit of control 497 frames and non-first fragments of a data message. An endpoint 498 receiving such a frame MUST _Fail the WebSocket Connection_. 500 PMCEs do not change the opcode field. The opcode of the first frame 501 of a compressed message indicates the opcode of the original message. 503 The payload data portion in frames generated by a PMCE is not subject 504 to the constraints for the original data type. For example, the 505 concatenation of the output data corresponding to the application 506 data portion of frames of a compressed text message is not required 507 to be valid UTF-8. At the receiver, the payload data portion after 508 decompression is subject to the constraints for the original data 509 type again. 511 6.2. Decompression 513 An endpoint MUST use the following algorithm to receive a message in 514 the form of a compressed message. 516 1. Concatenate the payload data portion of the received frames of 517 the compressed message. The received frames may be direct input 518 from the underlying transport or output of another WebSocket 519 extension depending on which extensions were negotiated. 521 2. Decompress the concatenation by following the decompression 522 procedure of the PMCE. 524 3. Process the decompressed message as follows: 526 * If this is the last extension to process incoming messages, 527 deliver the _A WebSocket Message Has Been Received_ event to 528 the application layer with the decompressed message payload 529 and header values including the "Per-message Compressed" bit 530 unset to 0. 532 * Otherwise, pass the decompressed message payload and header 533 values including the "Per-message Compressed" bit unset to 0 534 to the extension preceding the PMCE. If the extension expects 535 frames for input, build a frame for the message and pass it. 537 An endpoint MUST use the following algorithm to receive a message in 538 the form of an uncompressed message. 540 1. Process the received message as follows: 542 * If this PMCE is the last extension to process incoming 543 messages, deliver the _A WebSocket Message Has Been Received_ 544 event to the application layer with the received message 545 payload and header values as-is. 547 * Otherwise, pass the message payload and header values to the 548 extension preceding the PMCE as-is. If the extension expects 549 frames for input, build a frame for the message and pass it. 551 7. The permessage-deflate extension 553 This section defines a specific PMCE called "permessage-deflate". It 554 compresses the payload of a message using the DEFLATE algorithm 555 [RFC1951] and uses the byte boundary alignment method introduced in 556 [RFC1979]. 558 This section uses the term "byte" with the same meaning as RFC1951, 559 i.e. 8 bits stored or transmitted as a unit (same as an octet). 561 The registered extension name for this extension is 562 "permessage-deflate". 564 Four extension parameters are defined for "permessage-deflate" to 565 help endpoints manage per-connection resource usage. 567 o "server_no_context_takeover" 569 o "client_no_context_takeover" 571 o "server_max_window_bits" 573 o "client_max_window_bits" 575 These parameters enable two methods (no_context_takeover and 576 max_window_bits) of constraining memory usage that may be applied 577 independently to either direction of WebSocket traffic. The 578 extension parameters with the "client_" prefix are used by the client 579 to configure its compressor and by the server to configure its 580 decompressor. The extension parameters with the "server_" prefix are 581 used by the server to configure its compressor and by the client to 582 configure its decompressor. All four parameters are defined for both 583 a client's extension negotiation offer and a server's extension 584 negotiation response. 586 A server MUST decline an extension negotiation offer for this 587 extension if any of the following conditions are met: 589 o The negotiation offer contains an extension parameter not defined 590 for use in an offer. 592 o The negotiation offer contains an extension parameter with an 593 invalid value. 595 o The negotiation offer contains multiple extension parameters with 596 the same name. 598 o The server doesn't support the offered configuration. 600 A client MUST _Fail the WebSocket Connection_ if the peer server 601 accepted an extension negotiation offer for this extension with an 602 extension negotiation response meeting any of the following 603 conditions: 605 o The negotiation response contains an extension parameter not 606 defined for use in a response. 608 o The negotiation response contains an extension parameter with an 609 invalid value. 611 o The negotiation response contains multiple extension parameters 612 with the same name. 614 o The client does not support the configuration that the response 615 represents. 617 The term "LZ77 sliding window" used in this section means the buffer 618 used by the DEFLATE algorithm to store recently processed input. The 619 DEFLATE compression algorithm searches the buffer for a match with 620 the following input. 622 The term "use context take over" used in this section means that the 623 same LZ77 sliding window used by the endpoint to build frames of the 624 previous sent message is reused to build frames of the next message 625 to be sent. 627 7.1. Extension Parameters 629 7.1.1. Context Takeover Control 631 7.1.1.1. The server_no_context_takeover extension parameter 633 A client MAY include the "server_no_context_takeover" extension 634 parameter in an extension negotiation offer. This extension 635 parameter has no value. By including this extension parameter in an 636 extension negotiation offer, a client prevents the peer server from 637 using context take over. If the peer server doesn't use context take 638 over, the client doesn't need to reserve memory to retain the LZ77 639 sliding window between messages. 641 Absence of this extension parameter in an extension negotiation offer 642 indicates that the client can decompress a message which the server 643 built using context take over. 645 A server accepts an extension negotiation offer that includes the 646 "server_no_context_takeover" extension parameter by including the 647 "server_no_context_takeover" extension parameter in the corresponding 648 extension negotiation response to send back to the client. The 649 "server_no_context_takeover" extension parameter in an extension 650 negotiation response has no value. 652 It is RECOMMENDED that a server supports the 653 "server_no_context_takeover" extension parameter in an extension 654 negotiation offer. 656 A server MAY include the "server_no_context_takeover" extension 657 parameter in an extension negotiation response even if the extension 658 negotiation offer being accepted by the extension negotiation 659 response didn't include the "server_no_context_takeover" extension 660 parameter. 662 7.1.1.2. The client_no_context_takeover extension parameter 664 A client MAY include the "client_no_context_takeover" extension 665 parameter in an extension negotiation offer. This extension 666 parameter has no value. By including this extension parameter in an 667 extension negotiation offer, a client informs the peer server of a 668 hint that even if the server doesn't include the 669 "client_no_context_takeover" extension parameter in the corresponding 670 extension negotiation response to the offer, the client is not going 671 to use context take over. 673 A server MAY include the "client_no_context_takeover" extension 674 parameter in an extension negotiation response. If the received 675 extension negotiation offer includes the "client_no_context_takeover" 676 extension parameter, the server may either ignore the parameter or 677 use the parameter to avoid taking over the LZ77 sliding window 678 unnecessarily by including the "client_no_context_takeover" extension 679 parameter in the corresponding extension negotiation response to the 680 offer. The "client_no_context_takeover" extension parameter in an 681 extension negotiation response has no value. By including the 682 "client_no_context_takeover" extension parameter in an extension 683 negotiation response, a server prevents the peer client from using 684 context take over. This reduces the amount of memory that the server 685 has to reserve for the connection. 687 Absence of this extension parameter in an extension negotiation 688 response indicates that the server can decompress messages built by 689 the client using context take over. 691 A client MUST support the "client_no_context_takeover" extension 692 parameter in an extension negotiation response. 694 7.1.2. Limiting the LZ77 sliding window size 696 7.1.2.1. The server_max_window_bits extension parameter 698 A client MAY include the "server_max_window_bits" extension parameter 699 in an extension negotiation offer. This parameter has a decimal 700 integer value without leading zeroes between 8 to 15 inclusive 701 indicating the base-2 logarithm of the LZ77 sliding window size and 702 MUST conform to the ABNF below. 704 server_max_window_bits = 1*DIGIT 706 By including this parameter in an extension negotiation offer, a 707 client limits the LZ77 sliding window size that the server will use 708 to compress messages. If the peer server uses a small LZ77 sliding 709 window to compress messages, the client can reduce the memory needed 710 for the LZ77 sliding window. 712 A server declines an extension negotiation offer with this parameter 713 if the server doesn't support it. 715 Absence of this parameter in an extension negotiation offer indicates 716 that the client can receive messages compressed using an LZ77 sliding 717 window of up to 32,768 bytes. 719 A server accepts an extension negotiation offer with this parameter 720 by including the "server_max_window_bits" extension parameter in the 721 extension negotiation response to send back to the client with the 722 same or smaller value as the offer. The "server_max_window_bits" 723 extension parameter in an extension negotiation response has a 724 decimal integer value without leading zeroes between 8 to 15 725 inclusive indicating the base-2 logarithm of the LZ77 sliding window 726 size and MUST conform to the ABNF below. 728 server_max_window_bits = 1*DIGIT 730 A server MAY include the "server_max_window_bits" extension parameter 731 in an extension negotiation response even if the extension 732 negotiation offer being accepted by the response didn't include the 733 "server_max_window_bits" extension parameter. 735 7.1.2.2. The client_max_window_bits extension parameter 737 A client MAY include the "client_max_window_bits" extension parameter 738 in an extension negotiation offer. This parameter has no value or a 739 decimal integer value without leading zeroes between 8 to 15 740 inclusive indicating the base-2 logarithm of the LZ77 sliding window 741 size. If a value is specified for this parameter, the value MUST 742 conform to the ABNF below. 744 client_max_window_bits = 1*DIGIT 746 By including this parameter in an offer, a client informs the peer 747 server that the client supports the "client_max_window_bits" 748 extension parameter in an extension negotiation response, and 749 optionally a hint by attaching a value to the parameter. If the 750 "client_max_window_bits" extension parameter in an extension 751 negotiation offer has a value, the parameter also informs the peer 752 server of a hint that even if the server doesn't include the 753 "client_max_window_bits" extension parameter in the corresponding 754 extension negotiation response with a value greater than the one in 755 the extension negotiation offer or the server doesn't include the 756 extension parameter at all, the client is not going to use an LZ77 757 sliding window size greater than the size specified by the value in 758 the extension negotiation offer to compress messages. 760 If a received extension negotiation offer has the 761 "client_max_window_bits" extension parameter, the server MAY include 762 the "client_max_window_bits" extension parameter in the corresponding 763 extension negotiation response to the offer. If the 764 "client_max_window_bits" extension parameter in a received extension 765 negotiation offer has a value, the server may either ignore this 766 value or use this value to avoid allocating an unnecessarily big LZ77 767 sliding window by including the "client_max_window_bits" extension 768 parameter in the corresponding extension negotiation response to the 769 offer with a value equal to or smaller than the received value. The 770 "client_max_window_bits" extension parameter in an extension 771 negotiation response has a decimal integer value without leading 772 zeroes between 8 to 15 inclusive indicating the base-2 logarithm of 773 the LZ77 sliding window size and MUST conform to the ABNF below. 775 client_max_window_bits = 1*DIGIT 777 By including this extension parameter in an extension negotiation 778 response, a server limits the LZ77 sliding window size that the 779 client uses to compress messages. This reduces the amount of memory 780 for the decompression context that the server has to reserve for the 781 connection. 783 If a received extension negotiation offer doesn't have the 784 "client_max_window_bits" extension parameter, the corresponding 785 extension negotiation response to the offer MUST NOT include the 786 "client_max_window_bits" extension parameter. 788 Absence of this extension parameter in an extension negotiation 789 response indicates that the server can receive messages compressed 790 using an LZ77 sliding window of up to 32,768 bytes. 792 7.1.3. Examples 794 The simplest "Sec-WebSocket-Extensions" header in a client's opening 795 handshake to offer use of the permessage-deflate extension looks like 796 this: 798 Sec-WebSocket-Extensions: permessage-deflate 800 Since the "client_max_window_bits" extension parameter is not 801 included in this extension negotiation offer, the server must not 802 accept the offer with an extension negotiation response that includes 803 the "client_max_window_bits" extension parameter. The simplest 804 "Sec-WebSocket-Extensions" header in a server's opening handshake to 805 accept use of the permessage-deflate extension is the same: 807 Sec-WebSocket-Extensions: permessage-deflate 809 The following extension negotiation offer sent by a client is asking 810 the server to use an LZ77 sliding window with a size of 1,024 bytes 811 or less and declaring that the client supports the 812 "client_max_window_bits" extension parameter in an extension 813 negotiation response. 815 Sec-WebSocket-Extensions: 816 permessage-deflate; 817 client_max_window_bits; server_max_window_bits=10 819 This extension negotiation offer might be rejected by the server 820 because the server doesn't support the "server_max_window_bits" 821 extension parameter in an extension negotiation offer. This is fine 822 if the client cannot receive messages compressed using a larger 823 sliding window size, but if the client just prefers using a small 824 window but wants to fall back to the "permessage-deflate" without the 825 "server_max_window_bits" extension parameter, the client can make an 826 offer with the fallback option like this: 828 Sec-WebSocket-Extensions: 829 permessage-deflate; 830 client_max_window_bits; server_max_window_bits=10, 831 permessage-deflate; 832 client_max_window_bits 834 The server can accept permessage-deflate by picking any supported one 835 from the listed offers. To accept the first option, for example, the 836 server may send back a response as follows: 838 Sec-WebSocket-Extensions: 839 permessage-deflate; server_max_window_bits=10 841 To accept the second option, for example, the server may send back a 842 response as follows: 844 Sec-WebSocket-Extensions: permessage-deflate 846 7.2. Message Payload Transformation 848 7.2.1. Compression 850 An endpoint uses the following algorithm to compress a message. 852 1. Compress all the octets of the payload of the message using 853 DEFLATE. 855 2. If the resulting data does not end with an empty DEFLATE block 856 with no compression (the "BTYPE" bits are set to 00), append an 857 empty DEFLATE block with no compression to the tail end. 859 3. Remove 4 octets (that are 0x00 0x00 0xff 0xff) from the tail end. 860 After this step, the last octet of the compressed data contains 861 (possibly part of) the DEFLATE header bits with the "BTYPE" bits 862 set to 00. 864 When using DEFLATE in the first step above: 866 o An endpoint MAY use multiple DEFLATE blocks to compress one 867 message. 869 o An endpoint MAY use DEFLATE blocks of any type. 871 o An endpoint MAY use both DEFLATE blocks with the "BFINAL" bit set 872 to 0 and DEFLATE blocks with the "BFINAL" bit set to 1. 874 o When any DEFLATE block with the "BFINAL" bit set to 1 doesn't end 875 at a byte boundary, an endpoint MUST add minimal padding bits of 0 876 to make it end at a byte boundary. The next DEFLATE block follows 877 the padded data if any. 879 An endpoint fragments a compressed message by splitting the result of 880 running this algorithm. Even when only part of the payload is 881 available, a fragment can be built by compressing the available data 882 and choosing the block type appropriately so that the end of the 883 resulting compressed data is aligned at a byte boundary. Note that 884 for non-final fragments, the removal of 0x00 0x00 0xff 0xff MUST NOT 885 be done. 887 An endpoint MUST NOT use an LZ77 sliding window longer than 32,768 888 bytes to compress messages to send. 890 If the "agreed parameters" contain the "client_no_context_takeover" 891 extension parameter, the client MUST start compressing each new 892 message with an empty LZ77 sliding window. Otherwise, the client MAY 893 take over the LZ77 sliding window used to build the last compressed 894 message. Note that even if the client has included the 895 "client_no_context_takeover" extension parameter in its offer, the 896 client MAY take over the LZ77 sliding window used to build the last 897 compressed message if the "agreed parameters" don't contain the 898 "client_no_context_takeover" extension parameter. The client-to- 899 server "client_no_context_takeover" extension parameter is just a 900 hint for the server to build an extension negotiation response. 902 If the "agreed parameters" contain the "server_no_context_takeover" 903 extension parameter, the server MUST start compressing each new 904 message with an empty LZ77 sliding window. Otherwise, the server MAY 905 take over the LZ77 sliding window used to build the last compressed 906 message. 908 If the "agreed parameters" contain the "client_max_window_bits" 909 extension parameter with a value of w, the client MUST NOT use an 910 LZ77 sliding window longer than the w-th power of 2 bytes to compress 911 messages to send. Note that even if the client has included in its 912 offer the "client_max_window_bits" extension parameter with a value 913 smaller than one in the "agreed parameters", the client MAY use an 914 LZ77 sliding window with any size to compress messages to send as 915 long as the size conforms to the "agreed parameters". The client-to- 916 server "client_max_window_bits" extension parameter is just a hint 917 for the server to build an extension negotiation response. 919 If the "agreed parameters" contain the "server_max_window_bits" 920 extension parameter with a value of w, the server MUST NOT use an 921 LZ77 sliding window longer than the w-th power of 2 bytes to compress 922 messages to send. 924 7.2.2. Decompression 926 An endpoint uses the following algorithm to decompress a message. 928 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the 929 payload of the message. 931 2. Decompress the resulting data using DEFLATE. 933 If the "agreed parameters" contain the "server_no_context_takeover" 934 extension parameter, the client MAY decompress each new message with 935 an empty LZ77 sliding window. Otherwise, the client MUST decompress 936 each new message using the LZ77 sliding window used to process the 937 last compressed message. 939 If the "agreed parameters" contain the "client_no_context_takeover" 940 extension parameter, the server MAY decompress each new message with 941 an empty LZ77 sliding window. Otherwise, the server MUST decompress 942 each new message using the LZ77 sliding window used to process the 943 last compressed message. Note that even if the client has included 944 the "client_no_context_takeover" extension parameter in its offer, 945 the server MUST decompress each new message using the LZ77 sliding 946 window used to process the last compressed message if the "agreed 947 parameters" don't contain the "client_no_context_takeover" extension 948 parameter. The client-to-server "client_no_context_takeover" 949 extension parameter is just a hint for the server to build an 950 extension negotiation response. 952 If the "agreed parameters" contain the "server_max_window_bits" 953 extension parameter with a value of w, the client MAY reduce the size 954 of its LZ77 sliding window to decompress received messages down to 955 the w-th power of 2 bytes. Otherwise, the client MUST use a 32,768 956 byte LZ77 sliding window to decompress received messages. 958 If the "agreed parameters" contain the "client_max_window_bits" 959 extension parameter with a value of w, the server MAY reduce the size 960 of its LZ77 sliding window to decompress received messages down to 961 the w-th power of 2 bytes. Otherwise, the server MUST use a 32,768 962 byte LZ77 sliding window to decompress received messages. Note that 963 even if the client has included in its offer the 964 "client_max_window_bits" extension parameter with a value smaller 965 than one in the "agreed parameters", the client MUST use an LZ77 966 sliding window of a size that conforms the "agreed parameters" to 967 compress messages to send. The client-to-server 968 "client_max_window_bits" extension parameter is just a hint for the 969 server to build an extension negotiation response. 971 7.2.3. Examples 973 This section introduces examples of how the permessage-deflate 974 extension transforms messages. 976 7.2.3.1. A message compressed using 1 compressed DEFLATE block 978 Suppose that an endpoint sends a text message "Hello". If the 979 endpoint uses 1 compressed DEFLATE block (compressed with fixed 980 Huffman code and the "BFINAL" bit not set) to compress the message, 981 the endpoint obtains the compressed data to use for the message 982 payload as follows. 984 The endpoint compresses "Hello" into 1 compressed DEFLATE block and 985 flushes the resulting data into a byte array using an empty DEFLATE 986 block with no compression: 988 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 0x00 0xff 0xff 990 By stripping 0x00 0x00 0xff 0xff from the tail end, the endpoint gets 991 the data to use for the message payload: 993 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 995 Suppose that the endpoint sends this compressed message without 996 fragmentation. The endpoint builds one frame by putting the whole 997 compressed data in the payload data portion of the frame: 999 0xc1 0x07 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1001 The first 2 octets (0xc1 0x07) are the WebSocket frame header (FIN=1, 1002 RSV1=1, RSV2=0, RSV3=0, opcode=text, MASK=0, Payload length=7). The 1003 following figure shows what value is set in each field of the 1004 WebSocket frame header. 1006 0 1 1007 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1008 +-+-+-+-+-------+-+-------------+ 1009 |F|R|R|R| opcode|M| Payload len | 1010 |I|S|S|S| |A| | 1011 |N|V|V|V| |S| | 1012 | |1|2|3| |K| | 1013 +-+-+-+-+-------+-+-------------+ 1014 |1|1|0|0| 1 |0| 7 | 1015 +-+-+-+-+-------+-+-------------+ 1017 Suppose that the endpoint sends the compressed message with 1018 fragmentation. The endpoint splits the compressed data into 1019 fragments and builds frames for each fragment. For example, if the 1020 fragments are 3 and 4 octet, the first frame is: 1022 0x41 0x03 0xf2 0x48 0xcd 1024 and the second frame is: 1026 0x80 0x04 0xc9 0xc9 0x07 0x00 1028 Note that the RSV1 bit is set only on the first frame. 1030 7.2.3.2. Sharing LZ77 Sliding Window 1032 Suppose that a client has sent a message "Hello" as a compressed 1033 message and will send the same message "Hello" again as a compressed 1034 message. 1036 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1038 The above is the payload of the first message that the client has 1039 sent. If the "agreed parameters" contain the 1040 "client_no_context_takeover" extension parameter, the client 1041 compresses the payload of the next message into the same bytes (if 1042 the client uses the same "BTYPE" value and "BFINAL" value). So, the 1043 payload of the second message will be: 1045 0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00 1047 If the "agreed parameters" did not contain the 1048 "client_no_context_takeover" extension parameter, the client can 1049 compress the payload of the next message into less bytes by 1050 referencing the history in the LZ77 sliding window. So, the payload 1051 of the second message will be: 1053 0xf2 0x00 0x11 0x00 0x00 1055 So, 2 bytes are saved in total. 1057 Note that even if some uncompressed messages (with the RSV1 bit 1058 unset) are inserted between the two "Hello" messages, they don't 1059 affect the LZ77 sliding window. 1061 7.2.3.3. Using a DEFLATE Block with No Compression 1063 0xc1 0x0b 0x00 0x05 0x00 0xfa 0xff 0x48 0x65 0x6c 0x6c 0x6f 0x00 1065 This is a frame constituting a text message "Hello" built using a 1066 DEFLATE block with no compression. The first 2 octets (0xc1 0x0b) 1067 are the WebSocket frame header (FIN=1, RSV1=1, RSV2=0, RSV3=0, 1068 opcode=text, MASK=0, Payload length=7). Note that the RSV1 bit is 1069 set for this message (only on the first fragment if the message is 1070 fragmented) because the RSV1 bit is set when DEFLATE is applied to 1071 the message, including the case when only DEFLATE blocks with no 1072 compression are used. The 3rd to 13th octets consist the payload 1073 data containing "Hello" compressed using a DEFLATE block with no 1074 compression. 1076 7.2.3.4. Using a DEFLATE Block with BFINAL Set to 1 1078 On platforms on which the flush method using an empty DEFLATE block 1079 with no compression is not available, implementors can choose to 1080 flush data using DEFLATE blocks with "BFINAL" set to 1. 1082 0xf3 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00 1084 This is the payload of a message containing "Hello" compressed using 1085 a DEFLATE block with "BFINAL" set to 1. The first 7 octets 1086 constitute a DEFLATE block with "BFINAL" set to 1 and "BTYPE" set to 1087 01 containing "Hello". The last 1 octet (0x00) contains the header 1088 bits with "BFINAL" set to 0 and "BTYPE" set to 00, and 5 padding bits 1089 of 0. This octet is necessary to allow the payload to be 1090 decompressed in the same manner as messages flushed using DEFLATE 1091 blocks with BFINAL unset. 1093 7.2.3.5. Two DEFLATE Blocks in 1 Message 1095 Two or more DEFLATE blocks may be used in 1 message. 1097 0xf2 0x48 0x05 0x00 0x00 0x00 0xff 0xff 0xca 0xc9 0xc9 0x07 0x00 1099 The first 3 octets (0xf2 0x48 0x05) and the least significant two 1100 bits of the 4th octet (0x00) constitute one DEFLATE block with 1101 "BFINAL" set to 0 and "BTYPE" set to 01 containing "He". The rest of 1102 the 4th octet contains the header bits with "BFINAL" set to 0 and 1103 "BTYPE" set to 00, and the 3 padding bits of 0. Together with the 1104 following 4 octets (0x00 0x00 0xff 0xff), the header bits constitute 1105 an empty DEFLATE block with no compression. A DEFLATE block 1106 containing "llo" follows the empty DEFLATE block. 1108 7.2.3.6. Generating an Empty Fragment Manually 1110 Suppose that an endpoint is sending data of unknown size. The 1111 endpoint may encounter the end of data signal from the data source 1112 when its buffer for uncompressed data is empty. In such a case, the 1113 endpoint just needs to send the last fragment with FIN bit set to 1 1114 and payload set to DEFLATE block(s) which contains 0 bytes of data. 1115 If the compression library being used doesn't generate any data when 1116 its buffer is empty, an empty uncompressed DEFLATE block can be built 1117 manually and used for this purpose as follows: 1119 0x00 1121 The only octet 0x00 contains the header bits with "BFINAL" set to 0 1122 and "BTYPE" set to 00, and 5 padding bits of 0. 1124 7.3. Implementation Notes 1126 On most common software development platforms, the DEFLATE 1127 compression library provides a method for aligning compressed data to 1128 byte boundaries using an empty DEFLATE block with no compression. 1129 For example, Zlib [Zlib] does this when "Z_SYNC_FLUSH" is passed to 1130 the deflate function. 1132 Some platforms may provide only methods to output and process 1133 compressed data with a ZLIB header and an Adler-32 checksum. On such 1134 platforms, developers need to write stub code to remove and 1135 complement them manually. 1137 To obtain a useful compression ratio, an LZ77 sliding window size of 1138 1,024 or more is RECOMMENDED. 1140 If a side disallows context takeover, its endpoint can easily figure 1141 out whether a certain message will be shorter if compressed or not. 1142 Otherwise, it's not easy to know whether future messages will benefit 1143 from having a certain message compressed. Implementors may employ 1144 some heuristics to determine this. 1146 8. Security Considerations 1148 There is a known exploit when history-based compression is combined 1149 with a secure transport [CRIME]. Implementors should pay attention 1150 to this point when integrating this extension with other extensions 1151 or protocols. 1153 9. IANA Considerations 1155 9.1. Registration of the "permessage-deflate" WebSocket Extension Name 1157 This section describes a WebSocket extension name registration in the 1158 WebSocket Extension Name Registry [RFC6455]. 1160 Extension Identifier 1161 permessage-deflate 1163 Extension Common Name 1164 WebSocket Per-message Deflate 1166 Extension Definition 1167 This document. 1169 Known Incompatible Extensions 1170 None 1172 The "permessage-deflate" extension name is used in the 1173 "Sec-WebSocket-Extensions" header in the WebSocket opening handshake 1174 to negotiate use of the permessage-deflate extension. 1176 9.2. Registration of the "Per-message Compressed" WebSocket Framing 1177 Header Bit 1179 This section describes a WebSocket framing header bit registration in 1180 the WebSocket Framing Header Bits Registry [RFC6455]. 1182 Value 1183 RSV1 1185 Description 1186 The message is compressed or not. RSV1 is set for compressed 1187 messages and unset for uncompressed messages. 1189 Reference 1190 Section 6 of this document. 1192 The "Per-message Compressed" framing header bit is used on the first 1193 fragment of data messages to indicate whether the payload of the 1194 message is compressed by the PMCE or not. 1196 10. Acknowledgements 1198 Special thanks to Patrick McManus who wrote up the initial 1199 specification of a DEFLATE-based compression extension for the 1200 WebSocket Protocol to which I referred to write this specification. 1202 Thanks to the following people who participated in discussions on the 1203 HyBi WG and contributed ideas and/or provided detailed reviews (the 1204 list is likely to be incomplete): Adam Rice, Alexander Philippou, 1205 Alexey Melnikov, Arman Djusupov, Bjoern Hoehrmann, Brian McKelvey, 1206 Dario Crivelli, Greg Wilkins, Inaki Baz Castillo, Jamie Lokier, 1207 Joakim Erdfelt, John A. Tamplin, Julian Reschke, Kenichi Ishibashi, 1208 Mark Nottingham, Peter Thorson, Roberto Peon, Salvatore Loreto, 1209 Simone Bordet, Tobias Oberstein and Yutaka Hirano. Note that people 1210 listed above didn't necessarily endorse the end result of this work. 1212 11. References 1214 11.1. Normative References 1216 [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification 1217 version 1.3", RFC 1951, May 1996. 1219 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1220 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1222 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1223 RFC 6455, December 2011. 1225 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1226 Requirement Levels", BCP 14, RFC 2119, March 1997. 1228 [LZ77] Ziv, J. and A. Lempel, "A Universal Algorithm for 1229 Sequential Data Compression", IEEE Transactions on 1230 Information Theory, Vol. 23, No. 3, pp. 337-343. 1232 11.2. Informative References 1234 [RFC1979] Woods, J., "PPP Deflate Protocol", RFC 1979, August 1996. 1236 [Zlib] Gailly, J. and M. Adler, "Zlib", . 1238 [CRIME] Rizzo, J. and T. Duong, "The CRIME attack", Ekoparty 2012, 1239 September 2012. 1241 Author's Address 1243 Takeshi Yoshino 1244 Google, Inc. 1246 Email: tyoshino@google.com