Protocol::WebSocket::Frame - WebSocket Frame
# Create frame my $frame = Protocol::WebSocket::Frame->new('123'); $frame->to_string; # \x00123\xff # Parse frames my $frame = Protocol::WebSocket::Frame->new; $frame->append("123\x00foo\xff56\x00bar\xff789"); $f->next; # foo $f->next; # bar
Construct or parse a WebSocket frame.
new
Create a new Protocol::WebSocket::Frame instance.
append
$frame->append("\x00foo"); $frame->append("bar\xff");
Append a frame chunk.
next
$frame->append("\x00foo"); $frame->append("\xff\x00bar\xff"); $fram->next; # foo $fram->next; # bar
Return the next frame.
to_string
my $frame = Protocol::WebSocket::Frame->new('foo'); $frame->to_string; # \x00foo\xff
Construct a WebSocket frame.
To install Protocol::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::WebSocket
CPAN shell
perl -MCPAN -e shell install Protocol::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.