Skip Menu |

This queue is for tickets about the Net-Async-WebSocket CPAN distribution.

Report information
The Basics
Id: 122052
Status: resolved
Priority: 0/
Queue: Net-Async-WebSocket

People
Owner: Nobody in particular
Requestors: wolfsage [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.12



Subject: Net::Async::WebSocket::Client send_frame sends invalid websocket frames
The docs say: $client->connect( url => "ws://$HOST:$PORT/", )->then( sub { $client->send_frame( "Hello, world!\n" ); })->get; However, if you send the above, it's passed up to the server unmasked. This is invalid according to the RFC (https://tools.ietf.org/html/rfc6455#section-5.1): In the WebSocket Protocol, data is transmitted using a sequence of frames. To avoid confusing network intermediaries (such as intercepting proxies) and for security reasons that are further discussed in Section 10.3, a client MUST mask all frames that it sends to the server (see Section 5.3 for further details). (Note that masking is done whether or not the WebSocket Protocol is running over TLS.) The server MUST close the connection upon receiving a frame that is not masked. In testing, we found this to be true. We can work around it by doing: $client->send_frame(buffer => "hello world", masked => 1); But I think Net::Async::WebSocket::Client should implicitly mask things if we use the documented form of just passing a string. Thanks.
On Thu Jun 08 09:19:02 2017, wolfsage@gmail.com wrote: Show quoted text
> But I think Net::Async::WebSocket::Client should implicitly mask > things if we use the documented form of just passing a string.
Indeed, turns out to be a duplicate of RT88441 -- Paul Evans
Should now be solved with 0.12 -- Paul Evans