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!
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!