Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/motemen/plack-middleware-websocket

WebSocket handshake helper middleware
https://github.com/motemen/plack-middleware-websocket

Last synced: 3 months ago
JSON representation

WebSocket handshake helper middleware

Awesome Lists containing this project

README

        

=head1 OBSOLETE - Not up to date with the latest protocol

Maybe you're searching for: L

=head1 NAME

Plack::Middleware::WebSocket - Support WebSocket implementation

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

=head1 DESCRIPTION

Plack::Middleware::WebSocket provides WebSocket implementation through $env->{'websocket.impl'}.
Currently implements draft-ietf-hybi-thewebsocketprotocol-00 .

=head1 METHODS

=over 4

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

=back

=head1 AUTHOR

motemen [email protected]

=head1 SEE ALSO

=head1 LICENSE

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