actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

Modify WebSocket continuation support to not expose Continuations at Message-level

Open djahandarie opened this issue 4 years ago • 4 comments

Right now the WebSocket implementation, while it does support continuation frames, does nothing to combine those frames together into single messages, making it somewhat difficult to use the library. (This is especially important because, as noted in the former WS continuation issue, Chrome uses continuations all the time.)

I think the intent of the WebSocket RFC is for you to not need to worry about continuations at the message level, so the Message struct probably shouldn't include them.

djahandarie avatar Feb 11 '20 00:02 djahandarie

Would this be a breaking change?

juchiast avatar Mar 05 '20 14:03 juchiast

+1 for this feature, most WS libraries that I know does not expose Continuation frame.

juchiast avatar Mar 05 '20 14:03 juchiast

I just read through the original PR that got merged to add continuation support. Is it not these lines which merge continuation frames into a buffer and then send out a text or binary message?

Edit: looks like it was removed at some point

manstie avatar Nov 14 '21 11:11 manstie

having messed around with it, i think this can be done in a non-breaking way (providing an option to combine) so pushing to post-v4

robjtede avatar Jan 25 '22 12:01 robjtede

@robjtede I'd like to make a pr on this. Shall I do it in a non-breaking way still?

Or it's okay to remove Continuation type from user-facing ws::Message enum now?

adwinwhite avatar Dec 01 '22 13:12 adwinwhite