Repository metrics
- Stars
- (1,311 stars)
- PR merge metrics
- (Avg merge 1d 10h) (2 merged PRs in 30d)
Description
Hi, I found a problem that WebSocket server never send back WebSocket Close Connection when server output is infinite. Some WS libraries can't close connection because of this problem(At least SocketRocket and jetfire can't close connection).
I checked InfinitOutputServer.scala never send back Close connection and InfinitOutputServer.js do send back close connection using wireshark.
InfinitOutputServer.scala result is:

And InfinitOutputServer.js result is:

rfc6455 says:
If an endpoint receives a Close frame and did not previously send a Close frame, the endpoint MUST send a Close frame in response. (When sending a Close frame in response, the endpoint typically echos the status code it received.) It SHOULD do so as soon as practical. An endpoint MAY delay sending a Close frame until its current message is sent (for instance, if the majority of a fragmented message is already sent, an endpoint MAY send the remaining fragments before sending a Close frame). However, there is no guarantee that the endpoint that has already sent a Close frame will continue to process data.
I guess current behavior breaks RFC because of the endpoint MUST send a Close frame in response..
Problematic code is here