Closed wilson0028 closed 2 years ago
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.
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.
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).
Update: I believe I have found the issue with the compression extension. Will be fixed shortly.
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.
@wilson0028 if you install the main branch of simple-websocket you should be able to use compression, with all web servers.
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!