proxy.http.websocket.frame module#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

class proxy.http.websocket.frame.WebsocketFrame[source]#

Bases: object

Websocket frames parser and constructor.

GUID = b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'#
static apply_mask(data: bytes, mask: bytes) bytes[source]#
build() bytes[source]#
data: Optional[bytes]#
fin: bool#
static key_to_accept(key: bytes) bytes[source]#
mask: Optional[bytes]#
masked: bool#
opcode: int#
parse(raw: bytes) bytes[source]#
parse_fin_and_rsv(byte: int) None[source]#
parse_mask_and_payload(byte: int) None[source]#
payload_length: Optional[int]#
reset() None[source]#
rsv1: bool#
rsv2: bool#
rsv3: bool#
classmethod text(data: bytes) bytes[source]#
class proxy.http.websocket.frame.WebsocketOpcodes(CONTINUATION_FRAME, TEXT_FRAME, BINARY_FRAME, CONNECTION_CLOSE, PING, PONG)#

Bases: tuple

BINARY_FRAME: int#

Alias for field number 2

CONNECTION_CLOSE: int#

Alias for field number 3

CONTINUATION_FRAME: int#

Alias for field number 0

PING: int#

Alias for field number 4

PONG: int#

Alias for field number 5

TEXT_FRAME: int#

Alias for field number 1

_asdict()#

Return a new dict which maps field names to their values.

_field_defaults = {}#
_fields = ('CONTINUATION_FRAME', 'TEXT_FRAME', 'BINARY_FRAME', 'CONNECTION_CLOSE', 'PING', 'PONG')#
classmethod _make(iterable)#

Make a new WebsocketOpcodes object from a sequence or iterable

_replace(**kwds)#

Return a new WebsocketOpcodes object replacing specified fields with new values