Alice::HTTP::WebSocket - Support WebSocket implementation
builder { enable 'WebSocket'; sub { my $env = shift; ... if (my $fh = $env->{'websocket.impl'}->handshake) { # interact via $fh ... } else { $res->code($env->{'websocket.impl'}->error_code); } }; };
Alice::HTTP::WebSocket provides WebSocket implementation through $env->{'websocket.impl'}. Currently implements draft-ietf-hybi-thewebsocketprotocol-00 <http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00>.
Starts WebSocket handshake and returns filehandle on successful handshake. If failed, $env->{'websocket.impl'}->error_code is set to an HTTP code.
motemen <motemen@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Alice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Alice
CPAN shell
perl -MCPAN -e shell install Alice
For more information on module installation, please visit the detailed CPAN module installation guide.