Fixed Websocket problem with latest Firefox versions #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest Firefox versions (>=37) are using permessage compression.
The current implementation of permessage compression in websocket-sharp
is incorrect because it creates a new DeflateStream object for every
message, but this is only allowed, if client_no_context_takeover or
server_no_context_takeover has been agreed during the handshake.
Otherwise the DeflateStream object would need to be persisted and reused
for each connection, in order to implement the LZ77 sliding window.
I tried to copy over some stuff from websocket-sharp, to include
client_no_context_takeover and server_no_context_takeover, but that does
not have any effect on the Firefox behaviour. According to the spec, the
server may just acknowledge the extensions requested by the client, but
may not add options (like client_no_context_takeover). As a consequence,
this didn't solve the problem.
The final solution would of course be to change the code to reuse the
DeflateStream objects, but it hasn't even been done in webbsocket-sharp.
Instead websocket-sharp has introduced an IgnoreExtensions property
which effectively disables lines 163-165 in WebSocket.cs. I have
commented these out in our code as a quick fix. As a result permessage
compression is simply disabled.
This change finally made Emby-Websockets on Firefox clients work again!