Dancer2-Plugin-WebSocket

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
    // 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

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
    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 )