Net::WebSocket::Handshake::Client
my $hsk = Net::WebSocket::Handshake::Client->new( #required uri => 'ws://haha.test', #optional subprotocols => [ 'echo', 'haha' ], #optional, base 64 .. auto-created if not given key => '..', ); #Includes only one trailing CRLF, so you can add additional headers my $txt = $hsk->create_header_text(); my $b64 = $hsk->get_key(); #Validates the value of the “Sec-WebSocket-Accept” header; #throws Net::WebSocket::X::BadAccept if not. $hsk->validate_accept_or_die($accent_value);
To install Net::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::WebSocket
CPAN shell
perl -MCPAN -e shell install Net::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.