fastwebsockets icon indicating copy to clipboard operation
fastwebsockets copied to clipboard

permessage-deflate

Open willrnch opened this issue 2 years ago • 4 comments

willrnch avatar Aug 02 '23 14:08 willrnch

What is the state of this implementation?

(I have built a websocket server for some production use-case with this lib. The clients are in flutter. Now I'm seeing a bunch of errors like ReservedBitsNotZero, InvalidValue while reading from the socket. My guess is, the client is doing compression 😅 I'm worried now that this doesn't have support yet).

spy16x avatar Jun 27 '25 17:06 spy16x

What is the state of this implementation?

(I have built a websocket server for some production use-case with this lib. The clients are in flutter. Now I'm seeing a bunch of errors like ReservedBitsNotZero, InvalidValue while reading from the socket. My guess is, the client is doing compression 😅 I'm worried now that this doesn't have support yet).

I am seeing these too "ReservedBitsNotZero, InvalidValue while reading from the socket.". Originally, I believe it to be due to client-side deflate compression, however, strangely inspecting the raw packets in wireshark showed no set bits.

Regardless - what is required to help get this PR over the line ?

Also, is "ReservedBitsNotZero, InvalidValue while reading from the socket.". definitely not a parsing/decoding bug from the underlying library framing?

Thanks

pboft avatar Oct 31 '25 12:10 pboft

@pboft

The socket read/write are not cancellation safe. So if you're using them with tokio::select! or something it can cause partial frame reads and corrupt the whole stream.

This is what was happening in my case. Not related to compression.

I'd suggest you check this in your usecase too.

spy16x avatar Oct 31 '25 18:10 spy16x

@pboft

The socket read/write are not cancellation safe. So if you're using them with tokio::select! or something it can cause partial frame reads and corrupt the whole stream.

This is what was happening in my case. Not related to compression.

I'd suggest you check this in your usecase too.

That's super helpful, sounds like it's exactly what might be happening. I'll check that out ASAP.

pboft avatar Nov 03 '25 08:11 pboft

What is the state of this implementation?

The current implementation support the most basic case and will inflate the message sent by the client if needed. There is no protocol negotiation whatsoever so none of the extension parameters are supported (i.e. the server will not deflate any message, context takeover cannot be disabled and LZ77 sliding window size cannot be configured).

I'm working on protocol negotiation and will try to push soon.

willrnch avatar Nov 27 '25 23:11 willrnch

What is the state of this implementation?

The current implementation support the most basic case and will inflate the message sent by the client if needed. There is no protocol negotiation whatsoever so none of the extension parameters are supported (i.e. the server will not deflate any message, context takeover cannot be disabled and LZ77 sliding window size cannot be configured).

I'm working on protocol negotiation and will try to push soon.

hey @willrnch any update on this? happy to help

EvolveArt avatar Dec 22 '25 17:12 EvolveArt