-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
base: master
Are you sure you want to change the base?
Conversation
@@ -555,7 +603,11 @@ namespace crow | |||
if (is_FIN()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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? ;)
There was a problem hiding this comment.
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.
May I ask you to provide unit tests? |
I'll try to add some unit-tests for this. Thanks for the review. |
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.