Skip to content
ThreaT edited this page May 15, 2015 · 20 revisions

Overview

Frames can be parts or all of a text or binary data message that is sent from a client or server.

CloseFrame

Unknown

CloseFrameBuilder

Unknown

FrameBuilder

Unknown

Framedata

This interface provides the layout of a frame.

isFin() represents the first bit in the frame which marks the frame as the final or non-final frame of a message. Messages are made up of multiple frames.

getTransferredMasked() is the 8th bit and is used to determine if the clients payload is masked. Masking payloads is used to prevent proxy cache poisoning attacks. The 32-bit value taken from the frame header that masks the payload is placed between bits 48-80.

getOpcode() are bits 3-7 and is used to determine the type of data that the frame is sending. 0 - Continuation Frame 1 - Text Frame 2- Binary Frame 8 - Connection Close Frame 9 - Ping Frame 10 - Pong Frame

Missing Method it is recommended that a new method be introduced to identify payload length. Draft_10 already has payload length inside translateSingleFrame method. Payload length utilises bits 9-15. If payload length is 0-125 then the method should return the length. If the payload length is 126 then the method should read the following 16 bits and return the 16-bit unsigned integer they contain. If the payload length is 127 then the method should read the following 64 bits and return the 64-bit unsigned integer they contain.

getPayloadData() is used to get the payload data from bit 80 onwards.

append( Framedata nextframe ) is used to append another frame to the message. The maximum size for a single frame is 18,446,744,073,709,551,615 bytes but each frame implementation can handle this differently.

FramedataImpl1

Unknown