The Cro::WebSocket::Frame class represents WebSocket frame as defined per RFC 6455. The frame is assumed to be already unmasked/masked on parser/serializer level.

It exports Opcode enum that consists of possible frame opcodes, they are:

It can be used with full name qualification as follows

my $opcode = Cro::WebSocket::Frame::Opcode(0);


The class has three attributes, all of them are marked as rw;


fin class attribute is a Bool flag that indicates whether this message final or not.


opcode class attribute describes frame opcode.


payload is a Blob that contains Payload Data part of the frame. Payload is treated as a single blob, i.e. there is no distinction between Extension data and Application data on this level.