leedo > Alice-0.20 > Alice::HTTP::WebSocket

Download:
Alice-0.20.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Alice::HTTP::WebSocket - Support WebSocket implementation

SYNOPSIS ^

  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);
          }
      };
  };

DESCRIPTION ^

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>.

METHODS ^

my $fh = $env->{'websocket.impl'}->handshake;

Starts WebSocket handshake and returns filehandle on successful handshake. If failed, $env->{'websocket.impl'}->error_code is set to an HTTP code.

AUTHOR ^

motemen <motemen@gmail.com>

SEE ALSO ^

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: