draft-ietf-hybi-permessage-compression-21.txt   draft-ietf-hybi-permessage-compression-22.txt 
HyBi Working Group T. Yoshino HyBi Working Group T. Yoshino
Internet-Draft Google, Inc. Internet-Draft Google, Inc.
Intended status: Standards Track April 15, 2015 Intended status: Standards Track June 11, 2015
Expires: October 17, 2015 Expires: December 13, 2015
Compression Extensions for WebSocket Compression Extensions for WebSocket
draft-ietf-hybi-permessage-compression-21 draft-ietf-hybi-permessage-compression-22
Abstract Abstract
This document defines a framework for creating WebSocket extensions This document defines a framework for creating WebSocket extensions
that add compression functionality to the WebSocket Protocol. An that add compression functionality to the WebSocket Protocol. An
extension based on this framework compresses the payload data portion extension based on this framework compresses the payload data portion
of WebSocket data messages on a per-message basis using parameters of WebSocket data messages on a per-message basis using parameters
negotiated during the opening handshake. This framework provides a negotiated during the opening handshake. This framework provides a
general method for applying a compression algorithm to the contents general method for applying a compression algorithm to the contents
of WebSocket messages. Each compression algorithm has to be defined of WebSocket messages. Each compression algorithm has to be defined
skipping to change at page 1, line 42 skipping to change at page 1, line 42
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current. Drafts is at http://datatracker.ietf.org/drafts/current.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 17, 2015. This Internet-Draft will expire on December 13, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 9, line 27 skipping to change at page 9, line 27
between the output from the extension at the sender and the input between the output from the extension at the sender and the input
to the extension at the receiver. to the extension at the receiver.
o The extension uses the "Extension data" field or any of the o The extension uses the "Extension data" field or any of the
reserved bits on the WebSocket header as a per-frame attribute. reserved bits on the WebSocket header as a per-frame attribute.
A client that receives a response accepting a PMCE extension A client that receives a response accepting a PMCE extension
negotiation offer together with such an extension MUST _Fail the negotiation offer together with such an extension MUST _Fail the
WebSocket Connection_. WebSocket Connection_.
A server declining all offered PMCEs MUST not include any element A server declining all offered PMCEs MUST NOT include any element
with PMCE names. If a server responds with no PMCE element in the with PMCE names. If a server responds with no PMCE element in the
"Sec-WebSocket-Extensions" header, both endpoints proceed without "Sec-WebSocket-Extensions" header, both endpoints proceed without
Per-message Compression once _the WebSocket Connection is Per-message Compression once _the WebSocket Connection is
established_. established_.
If a server gives an invalid response, such as accepting a PMCE that If a server gives an invalid response, such as accepting a PMCE that
the client did not offer, the client MUST _Fail the WebSocket the client did not offer, the client MUST _Fail the WebSocket
Connection_. Connection_.
If a server responds with a valid PMCE element in the If a server responds with a valid PMCE element in the
skipping to change at page 13, line 6 skipping to change at page 13, line 6
messages, build frame(s) by using the compressed data instead of messages, build frame(s) by using the compressed data instead of
the original data for the message payload, and set the the original data for the message payload, and set the
"Per-message Compressed" bit of the first frame, then send the "Per-message Compressed" bit of the first frame, then send the
frame(s) as described in Section 6.1 of RFC6455. Otherwise, pass frame(s) as described in Section 6.1 of RFC6455. Otherwise, pass
the transformed message payload and modified header values the transformed message payload and modified header values
including the "Per-message Compressed" bit value set to 1 to the including the "Per-message Compressed" bit value set to 1 to the
extension next to the PMCE. If the extension expects frames for extension next to the PMCE. If the extension expects frames for
input, build a frame for the message and pass it. input, build a frame for the message and pass it.
An endpoint MUST use the following algorithm to send a message in the An endpoint MUST use the following algorithm to send a message in the
form of an uncompressed message. If this PMCE is the last extension form of an uncompressed message.
to process of outgoing messages, build frame(s) by using the original
data for the payload data portion as-is and unset the "Per-message 1. If this PMCE is the last extension to process of outgoing
Compressed" bit of the first frame, then send the frame(s) as messages, build frame(s) by using the original data for the
described in Section 6.1 of RFC6455. Otherwise, pass the message payload data portion as-is and unset the "Per-message Compressed"
payload and header values to the extension next to the PMCE as-is. bit of the first frame, then send the frame(s) as described in
If the extension expects frames for input, build a frame for the Section 6.1 of RFC6455. Otherwise, pass the message payload and
message and pass it. header values to the extension next to the PMCE as-is. If the
extension expects frames for input, build a frame for the message
and pass it.
An endpoint MUST NOT set the "Per-message Compressed" bit of control An endpoint MUST NOT set the "Per-message Compressed" bit of control
frames and non-first fragments of a data message. An endpoint frames and non-first fragments of a data message. An endpoint
receiving such a frame MUST _Fail the WebSocket Connection_. receiving such a frame MUST _Fail the WebSocket Connection_.
PMCEs do not change the opcode field. The opcode of the first frame PMCEs do not change the opcode field. The opcode of the first frame
of a compressed message indicates the opcode of the original message. of a compressed message indicates the opcode of the original message.
The payload data portion in frames generated by a PMCE is not subject The payload data portion in frames generated by a PMCE is not subject
to the constraints for the original data type. For example, the to the constraints for the original data type. For example, the
skipping to change at page 14, line 4 skipping to change at page 14, line 6
3. If this is the last extension to process incoming messages, 3. If this is the last extension to process incoming messages,
deliver the _A WebSocket Message Has Been Received_ event to the deliver the _A WebSocket Message Has Been Received_ event to the
application layer with the decompressed message payload and application layer with the decompressed message payload and
header values including the "Per-message Compressed" bit unset to header values including the "Per-message Compressed" bit unset to
0. Otherwise, pass the decompressed message payload and header 0. Otherwise, pass the decompressed message payload and header
values including the "Per-message Compressed" bit unset to 0 to values including the "Per-message Compressed" bit unset to 0 to
the extension preceding the PMCE. If the extension expects the extension preceding the PMCE. If the extension expects
frames for input, build a frame for the message and pass it. frames for input, build a frame for the message and pass it.
An endpoint MUST use the following algorithm to receive a message in An endpoint MUST use the following algorithm to receive a message in
the form of an uncompressed message. If this PMCE is the last the form of an uncompressed message.
extension to process incoming messages, deliver the _A WebSocket
Message Has Been Received_ event to the application layer with the 1. If this PMCE is the last extension to process incoming messages,
received message payload and header values as-is. Otherwise, pass deliver the _A WebSocket Message Has Been Received_ event to the
the message payload and header values to the extension preceding the application layer with the received message payload and header
PMCE as-is. If the extension expects frames for input, build a frame values as-is. Otherwise, pass the message payload and header
for the message and pass it. values to the extension preceding the PMCE as-is. If the
extension expects frames for input, build a frame for the message
and pass it.
7. Intermediaries 7. Intermediaries
When an intermediary proxies a WebSocket connection, the intermediary When an intermediary proxies a WebSocket connection, the intermediary
MAY add, change or remove Per-message Compression of proxied messages MAY add, change or remove Per-message Compression of proxied messages
if the intermediary meets all of the following requirements: if the intermediary meets all of the following requirements:
o The intermediary understands the PMCE. o The intermediary understands the PMCE.
o The intermediary can read all data of the proxied WebSocket o The intermediary can read all data of the proxied WebSocket
 End of changes. 6 change blocks. 
20 lines changed or deleted 24 lines changed or added

This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/