Skip to content

Commit

Permalink
actually show the response
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 8, 2015
1 parent eb71ecd commit 3bc22f3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -543,9 +543,7 @@ L<Mojolicious::Plugin::DefaultHelpers> and L<Mojolicious::Plugin::TagHelpers>.
my $cb = $c->on(finish => sub {...});
Subscribe to events of L</"tx">, which is usually a L<Mojo::Transaction::HTTP>
or L<Mojo::Transaction::WebSocket> object. Note that this method will
automatically respond to WebSocket handshake requests with a C<101> response
status.
or L<Mojo::Transaction::WebSocket> object.
# Do something after the transaction has been finished
$c->on(finish => sub {
Expand All @@ -572,6 +570,16 @@ status.
$c->app->log->debug("Received $len bytes");
});
This method will automatically respond to WebSocket handshake requests with a
C<101> response status, to establish the WebSocket connection.
HTTP/1.1 101 Switching Protocols
Server: Mojolicious (Perl)
Date: Tue, 03 Feb 2015 17:08:24 GMT
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Accept: SWsp5N2iNxPbHlcOTIw8ERvyVPY=
=head2 param
my $value = $c->param('foo');
Expand Down

0 comments on commit 3bc22f3

Please sign in to comment.