Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mention how to activate permessage-deflate compression in user agent
  • Loading branch information
kraih committed Feb 2, 2014
1 parent eb127ea commit b43ada2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
@@ -1,4 +1,6 @@

4.76 2014-02-03

4.75 2014-02-02
- Fixed and readded support for permessage-deflate WebSocket compression.
(Mikey, sri)
Expand Down
6 changes: 6 additions & 0 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -875,6 +875,12 @@ L<Mojo::Transaction::HTTP> object.
});
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
You can activate C<permessage-deflate> compression by setting the
C<Sec-WebSocket-Extensions> header.
my $headers = {'Sec-WebSocket-Extensions' => 'permessage-deflate'};
$ua->websocket('ws://example.com/foo' => $headers => sub {...});
=head1 DEBUGGING
You can set the MOJO_USERAGENT_DEBUG environment variable to get some advanced
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -43,7 +43,7 @@ has types => sub { Mojolicious::Types->new };
has validator => sub { Mojolicious::Validator->new };

our $CODENAME = 'Top Hat';
our $VERSION = '4.75';
our $VERSION = '4.76';

sub AUTOLOAD {
my $self = shift;
Expand Down
5 changes: 5 additions & 0 deletions lib/Test/Mojo.pm
Expand Up @@ -827,6 +827,11 @@ Perform request and check for transport errors.
my $tx = $t->ua->build_tx(FOO => '/test.json' => json => {foo => 1});
$t->request_ok($tx)->status_is(200)->json_is({success => 1});
# Custom WebSocket handshake
my $tx = $t->ua->build_websocket_tx('/foo');
$tx->req->headers->remove('UserAgent');
$t->request_ok($tx)->message_ok->message_is('bar')->finish_ok;
=head2 reset_session
$t = $t->reset_session;
Expand Down

0 comments on commit b43ada2

Please sign in to comment.