Subject: | send_frame not compatible with masked messages |
Date: | Fri, 24 Aug 2012 22:31:26 +0200 |
To: | bug-Net-Async-WebSocket [...] rt.cpan.org |
From: | qwr <qwr [...] au.ru> |
Net::Async::Protocol::send_frame is not compaible with "masked" messages
used in newer versions of websocket implementations.
Protocol::WebSocket::Frame has a support for that.
Net::Async::Protocol::send_frame
sends Protocol::WebSocket::Frame->new( $frame )->to_bytes
instead of
Protocol::WebSocket::Frame->new( buffer => $frame, masked => 1 )->to_bytes
an example is blockchain.info websockets implementation:
https://blockchain.info/api/api_websocket
I would make a proposal either just to add hardcoded masked param like
above or to pass whole @_:
sub send_frame
{
my $self = shift;
$self->write( Protocol::WebSocket::Frame->new( @_ )->to_bytes );
}
and let user define masked param.
mmx