jQluster::Server::WebSocket - jQluster server implementation using WebSocket transport
In your app.psgi
use Plack::Builder; use jQluster::Server::WebSocket; my $jq_server = jQluster::Server::WebSocket->new(); builder { mount "/jqluster", $jq_server->to_app; mount "/", $your_app; };
Then, in your JavaScript code
$.jqluster.init("my_node_id", "ws://myhost.mydomain/jqluster");
jQluster::Server::WebSocket is part of jQluster project. To learn more about jQluster, visit https://github.com/debug-ito/jQluster.
This module is a jQluster server implementation using simple WebSocket transport. It accepts WebSocket connections and distribute jQluster messages through the connections.
jQluster::Server::WebSocket creates a PSGI application. You can use it as a stand-alone app or mount it together with your own app.
Currently jQluster::Server::WebSocket uses Plack::App::WebSocket, so your PSGI server must meet its requirements.
The constructor. Fields in %args are
%args
logger
A subroutine reference that the server calls when it wants to log something.
The $logger is called like
$logger
$logger->($level, $message)
where $level is a log level string such as "info", "warning", "error" etc. $message is the log message string.
$level
$message
Create a PSGI application object from the $server.
$server
jQluster server independent of connection implementations.
WebSocket server implementation as a Plack app.
https://github.com/debug-ito/jQluster-Server-WebSocket
Please report bugs and feature requests to my Github issues https://github.com/debug-ito/jQluster-Server-WebSocket/issues.
Although I prefer Github, non-Github users can use CPAN RT https://rt.cpan.org/Public/Dist/Display.html?Name=jQluster-Server-WebSocket. Please send email to bug-jQluster-Server-WebSocket at rt.cpan.org to report bugs if you do not have CPAN RT account.
bug-jQluster-Server-WebSocket at rt.cpan.org
Toshio Ito, <toshioito at cpan.org>
<toshioito at cpan.org>
Copyright 2013 Toshio Ito.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install jQluster::Server::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm jQluster::Server::WebSocket
CPAN shell
perl -MCPAN -e shell install jQluster::Server::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.