Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support websocket compression #675

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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
@@ -555,7 +603,11 @@ namespace crow
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