From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

Amon2::Plugin::Web::WebSocket - [EXPERIMENTAL]WebSocket plugin for Amon2

SYNOPSIS

any '/echo' => sub {
my ($c) = @_;
return $c->websocket(sub {
my $ws = shift;
$ws->on_receive_message(sub {
my ($c, $message) = @_;
$ws->send_message("YAY: " . $message);
});
});
};

DESCRIPTION

This plugin provides WebSocket feature for Amon2.

You can use WebSocket very easily with Amon2.

This plugin depended on AnyEvent. You can use this module on Twiggy only.

METHODS

$c->websocket(\&callback);

SEE ALSO

Twiggy, AnyEvent