Dancer2-Plugin-WebSocket
view release on metacpan or search on metacpan
README.mkdn view on Meta::CPAN
123124125126127128129130131132133134135136137138139140141142143
// then later...
mySocket.sendJSON({ whoa:
"auto-serialization ftw!"
});
```
- mount\_path
Path
for
the websocket mountpoint. Defaults to `/ws`.
# PLUGIN KEYWORDS
In the various callbacks, the connection object `
$conn
`
is a [Plack::App::WebSocket::Connection](https://metacpan.org/pod/Plack::App::WebSocket::Connection) object
augmented
with
the [Dancer2::Plugin::WebSocket::Connection](https://metacpan.org/pod/Dancer2::Plugin::WebSocket::Connection) role.
## websocket\_on\_open sub { ... }
```perl
websocket_on_open
sub
{
my
(
$conn
,
$env
) =
@_
;
...;
};
lib/Dancer2/Plugin/WebSocket.pm view on Meta::CPAN
261262263264265266267268269270271272273274275276277278279280
mySocket.sendJSON({ whoa:
"auto-serialization ftw!"
});
=item mount_path
Path for the websocket mountpoint. Defaults to C</ws>.
=back
=head1 PLUGIN KEYWORDS
In the various callbacks, the connection object C<$conn>
is a L<Plack::App::WebSocket::Connection> object
augmented with the L<Dancer2::Plugin::WebSocket::Connection> role.
=head2 websocket_on_open sub { ... }
websocket_on_open sub {
my( $conn, $env ) = @_;
...;
};
( run in 0.245 second using v1.01-cache-2.11-cpan-ec4f86ec37b )