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

permessage-deflate compression support #11

Closed
wilson0028 opened this issue Apr 10, 2022 · 6 comments
Closed

permessage-deflate compression support #11

wilson0028 opened this issue Apr 10, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@wilson0028
Copy link

Is permessage-deflate compression supported on flask-sock? I know this is implemented with flask-socketio if you use eventlet but I can't seem to make compression work with flask-sock.

This is a great project and thank you for your work!

@miguelgrinberg
Copy link
Owner

Flask-Sock does not have its own websocket implementation, it relies on a 3rd party package. The support and negotiation of websocket extensions such as the one for message compression happens during the connection handshake and is not part of Flask-Sock duties.

Which websocket package are you using? I assume simple-websocket? I think that should work too, but I don't recall ever testing compression with this package.

@miguelgrinberg miguelgrinberg added the question Further information is requested label Apr 10, 2022
@wilson0028
Copy link
Author

I am using simple-websocket on the browser side and of course Flask-Sock on the server side. In the image below, you can see that the browser does ask for permessage-deflate but the response from the server doesn't include it.

Thank you for the information. I guess at this point I'll just need to use Flask-SocketIO to get compression.

web

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Apr 11, 2022

If you like the eventlet websocket why don't you use that instead of simple-websocket? I'm going to look into why simple-websocket does not accept compression, but Flask-Sock also works with eventlet and gevent websocket servers (documentation).

@miguelgrinberg miguelgrinberg added bug Something isn't working and removed question Further information is requested labels Apr 11, 2022
@miguelgrinberg miguelgrinberg self-assigned this Apr 11, 2022
@miguelgrinberg
Copy link
Owner

Update: I believe I have found the issue with the compression extension. Will be fixed shortly.

@wilson0028
Copy link
Author

I was going to add that I did try Flask-Sock with eventlet but was still unable to get compression to work. Hopefully that is related the the issue you found.

@miguelgrinberg miguelgrinberg transferred this issue from miguelgrinberg/flask-sock Apr 11, 2022
@miguelgrinberg
Copy link
Owner

@wilson0028 if you install the main branch of simple-websocket you should be able to use compression, with all web servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants