-
Notifications
You must be signed in to change notification settings - Fork 738
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
Unclear documentation on socket.compress(value) #219
Comments
That makes sense to me. |
Let's say I use the defaults everywhere. If I have a socket that is using the websocket transport, will it use compression or not?
That is what I am confused about. |
perMessageDeflate it's a different piece, check this out: https://github.com/websockets/ws#websocket-compression I understand "perMessageDeflate" as is in the documentation: ws supports the permessage-deflate extension which enables the client and server to negotiate a compression algorithm and its parameters, and then selectively apply it to the data payloads of each WebSocket message. However you are pointing to transports, that are polling or websocket. Both are compressed by default. websocket: "Defaults to true when you don’t call the method." points to yes. That's what I understood reading the docs. Would be good to see others opinion. |
@dverzolla I think this is a valid question. Then how is it compressed when A good note is to check the version 2 to 3 migration guide:
Could it be that the default compress does not work if changing transport to websocket, unless also changing (I could also have sworn I read somewhere that v3 would use websocket as the default transport, but the docs still says it uses polling and I also cannot find where I read this). |
@AntonNeld you are right, the documentation could be clearer on that point. If Which gives us:
@thernstig this was indeed discussed, but we did not include the change (we stood by the reasoning detailed here) |
Agree with you guys, as I arrived in socket.io on 3+ version, reading the documentation brought me to another understanding. Regards. |
The text here is a bit unclear about when compression is used.
As I understand it, websocket compression is turned off by default. This means that setting socket.compress(true) will not necessarily turn on compression (when using the websocket transport, anyway). Did I get that right? Could it be made clearer with an explicit sentence like "Whether compression is actually used also depends on whether it is enabled in the underlying transport"?
The text was updated successfully, but these errors were encountered: