autobahn.websocket.compress_deflate

Classes

PerMessageDeflate

permessage-deflate WebSocket extension processor.

PerMessageDeflateMixin

Mixin class for this extension.

PerMessageDeflateOffer

Set of extension parameters for permessage-deflate WebSocket extension

PerMessageDeflateOfferAccept

Set of parameters with which to accept an permessage-deflate offer

PerMessageDeflateResponse

Set of parameters for permessage-deflate responded by server.

PerMessageDeflateResponseAccept

Set of parameters with which to accept an permessage-deflate response

Module Contents

class PerMessageDeflate(is_server, server_no_context_takeover, client_no_context_takeover, server_max_window_bits, client_max_window_bits, mem_level, max_message_size=None)[source]

Bases: autobahn.websocket.compress_base.PerMessageCompress, PerMessageDeflateMixin

permessage-deflate WebSocket extension processor.

DEFAULT_MEM_LEVEL = 8[source]
DEFAULT_WINDOW_BITS = 15[source]
__json__()[source]
__repr__()[source]
_compressor = None[source]
_decompressor = None[source]
_is_server[source]
client_max_window_bits[source]
client_no_context_takeover[source]
compress_message_data(data)[source]
classmethod create_from_offer_accept(is_server, accept)[source]
classmethod create_from_response_accept(is_server, accept)[source]
decompress_message_data(data)[source]
end_compress_message()[source]
end_decompress_message()[source]
max_message_size = None[source]
mem_level[source]
server_max_window_bits[source]
server_no_context_takeover[source]
start_compress_message()[source]
start_decompress_message()[source]
class PerMessageDeflateMixin[source]

Bases: object

Mixin class for this extension.

EXTENSION_NAME = 'permessage-deflate'[source]

Name of this WebSocket extension.

MEM_LEVEL_PERMISSIBLE_VALUES = [1, 2, 3, 4, 5, 6, 7, 8, 9][source]

Permissible value for memory level parameter. Higher values use more memory, but are faster and produce smaller output. The default is 8.

WINDOW_SIZE_PERMISSIBLE_VALUES = [9, 10, 11, 12, 13, 14, 15][source]

Permissible value for window size parameter. Higher values use more memory, but produce smaller output. The default is 15.

class PerMessageDeflateOffer(accept_no_context_takeover=True, accept_max_window_bits=True, request_no_context_takeover=False, request_max_window_bits=0)[source]

Bases: autobahn.websocket.compress_base.PerMessageCompressOffer, PerMessageDeflateMixin

Set of extension parameters for permessage-deflate WebSocket extension offered by a client to a server.

__json__()[source]

Returns a JSON serializable object representation.

Returns:

JSON serializable representation.

Return type:

dict

__repr__()[source]

Returns Python object representation that can be eval’ed to reconstruct the object.

Returns:

Python string representation.

Return type:

str

accept_max_window_bits = True[source]
accept_no_context_takeover = True[source]
get_extension_string()[source]

Returns the WebSocket extension configuration string as sent to the server.

Returns:

PMCE configuration string.

Return type:

str

classmethod parse(params)[source]

Parses a WebSocket extension offer for permessage-deflate provided by a client to a server.

Parameters:

params (list) – Output from autobahn.websocket.WebSocketProtocol._parseExtensionsHeader().

Returns:

A new instance of autobahn.compress.PerMessageDeflateOffer.

Return type:

obj

request_max_window_bits = 0[source]
request_no_context_takeover = False[source]
class PerMessageDeflateOfferAccept(offer, request_no_context_takeover=False, request_max_window_bits=0, no_context_takeover=None, window_bits=None, mem_level=None, max_message_size=None)[source]

Bases: autobahn.websocket.compress_base.PerMessageCompressOfferAccept, PerMessageDeflateMixin

Set of parameters with which to accept an permessage-deflate offer from a client by a server.

__json__()[source]

Returns a JSON serializable object representation.

Returns:

JSON serializable representation.

Return type:

dict

__repr__()[source]

Returns Python object representation that can be eval’ed to reconstruct the object.

Returns:

Python string representation.

Return type:

str

get_extension_string()[source]

Returns the WebSocket extension configuration string as sent to the server.

Returns:

PMCE configuration string.

Return type:

str

max_message_size = None[source]
mem_level = None[source]
no_context_takeover = None[source]
offer[source]
request_max_window_bits = 0[source]
request_no_context_takeover = False[source]
window_bits = None[source]
class PerMessageDeflateResponse(client_max_window_bits, client_no_context_takeover, server_max_window_bits, server_no_context_takeover)[source]

Bases: autobahn.websocket.compress_base.PerMessageCompressResponse, PerMessageDeflateMixin

Set of parameters for permessage-deflate responded by server.

__json__()[source]

Returns a JSON serializable object representation.

Returns:

JSON serializable representation.

Return type:

dict

__repr__()[source]

Returns Python object representation that can be eval’ed to reconstruct the object.

Returns:

Python string representation.

Return type:

str

client_max_window_bits[source]
client_no_context_takeover[source]
classmethod parse(params)[source]

Parses a WebSocket extension response for permessage-deflate provided by a server to a client.

Parameters:

params (list) – Output from autobahn.websocket.WebSocketProtocol._parseExtensionsHeader().

Returns:

A new instance of autobahn.compress.PerMessageDeflateResponse.

Return type:

obj

server_max_window_bits[source]
server_no_context_takeover[source]
class PerMessageDeflateResponseAccept(response, no_context_takeover=None, window_bits=None, mem_level=None, max_message_size=None)[source]

Bases: autobahn.websocket.compress_base.PerMessageCompressResponseAccept, PerMessageDeflateMixin

Set of parameters with which to accept an permessage-deflate response from a server by a client.

__json__()[source]

Returns a JSON serializable object representation.

Returns:

JSON serializable representation.

Return type:

dict

__repr__()[source]

Returns Python object representation that can be eval’ed to reconstruct the object.

Returns:

Python string representation.

Return type:

str

max_message_size = None[source]
mem_level = None[source]
no_context_takeover = None[source]
response[source]
window_bits = None[source]