Skip to content

Conversation

MichaelSB
Copy link
Contributor

@MichaelSB MichaelSB commented Jul 1, 2023

This adds support for websocket compression via permessage-deflate extension. It's based on ipkn/crow#329, with a few changes to better match current crow. It resolves #92
I was not able to use the current implementation of zlib. This needs state, which the current implementation does not support. It's enabled whenever CROW_ENABLE_COMPRESSION is defined.
I tested it with my very websocket heavy app on recent chrome and firefox and it works as expected. Please let me know, if there's anything I need to change.

@gittiver gittiver added the feature Code based project improvement label Jan 29, 2024
case 0: // Continuation
{
message_ += fragment_;
if (is_FIN())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this if to separate method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do

#ifdef CROW_ENABLE_COMPRESSION
if (compressor_)
{
opcode += 0x40;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find where this comes from. May I ask you to send a link to spec? ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll look for it. Might take some time. I'm currently very busy sadly.

@mrozigor
Copy link
Member

mrozigor commented Mar 9, 2024

May I ask you to provide unit tests?

@MichaelSB
Copy link
Contributor Author

I'll try to add some unit-tests for this. Thanks for the review.

@gittiver gittiver added the further information required existing information is lacking, or feedback is required label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Code based project improvement further information required existing information is lacking, or feedback is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Websocket Compression

3 participants