Protocol::WebSocket::Handshake::Client3pm
Websocket client handshake
Usage
my $h =Protocol::WebSocket::Handshake::Client->new(url => 'ws://example.com');# Create request$h->to_string;# Parse server response$h->parse(<<"EOF");WebSocket HTTP messageEOF$h->error; # Check if there were any errors$h->is_done; # Returns 1
Overview
Construct or parse a client WebSocket handshake. This module is written for convenience, since using request and response directly requires the same code again and again.
Attributes
"url"
$handshake->url('ws://example.com/demo');
Set or get WebSocket url.
Methods
"new"
Create a new Protocol::WebSocket::Handshake::Client instance.
"parse"
$handshake->parse($buffer);
Parse a WebSocket server response. Returns "undef" and sets "error" attribute on error. Buffer is modified.
"to_string"
Construct a WebSocket client request.
"is_done"
Check whether handshake is done.
Releases
3 releases since Debian 11 (Bullseye); the text changed 1 time.