autobahn.websocket.compress_deflate


Module Contents

Classes

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

PerMessageDeflate

permessage-deflate WebSocket extension processor.

class autobahn.websocket.compress_deflate.PerMessageDeflateMixin[source]

Bases: object

Mixin class for this extension.

EXTENSION_NAME = permessage-deflate

Name of this WebSocket extension.

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

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

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

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

class autobahn.websocket.compress_deflate.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.

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

get_extension_string()[source]

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

Returns

PMCE configuration string.

Return type

str

__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

class autobahn.websocket.compress_deflate.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.

get_extension_string()[source]

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

Returns

PMCE configuration string.

Return type

str

__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

class autobahn.websocket.compress_deflate.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.

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

__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

class autobahn.websocket.compress_deflate.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

class autobahn.websocket.compress_deflate.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_WINDOW_BITS
DEFAULT_MEM_LEVEL = 8
classmethod create_from_response_accept(is_server, accept)[source]
classmethod create_from_offer_accept(is_server, accept)[source]
__json__()[source]
__repr__()[source]

Return repr(self).

start_compress_message()[source]
compress_message_data(data)[source]
end_compress_message()[source]
start_decompress_message()[source]
decompress_message_data(data)[source]
end_decompress_message()[source]