This is automatic generated document for things in Swow\WebSocket\WebSocket class

Class WebSocket

Constants

public DEFAULT_MASKING_KEY = "258E" public EMPTY_MASKING_KEY = "" public EXT16_MAX_LENGTH = 65535 public EXT16_PAYLOAD_LENGTH = 126 public EXT64_PAYLOAD_LENGTH = 127 public EXT8_MAX_LENGTH = 125 public GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" public HEADER_MAX_SIZE = 14 public HEADER_MIN_SIZE = 2 public MASKING_KEY_LENGTH = 4 public PING_FRAME = public PONG_FRAME = public SECRET_KEY_ENCODED_LENGTH = 24 public SECRET_KEY_LENGTH = 16 public VERSION = 13

Methods

Static method mask

public static function mask ( \Stringable|string $data , int $start , int $length , string $maskingKey , int $index ) : string

Mask data.

An empty key gives the input unchanged. The default key is empty.

Param string $maskingKey 0 or 4 bytes

Returns string the masked data

Throws \ValueError when the key has another length

Static method unmask

public static function unmask ( \Swow\Buffer $data , int $start , int $length , string $maskingKey , int $index ) : void

Unmask the buffer in place.

Param string $maskingKey 0 or 4 bytes

Throws \ValueError when the key has another length


Copyright 2022 the Swow contributors