TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.46k stars 2.57k forks source link

Question: How can the compression threshold be set for the PerMessageDeflateExtension in a Deflate Client? #1437

Open CommuniG8 opened 2 weeks ago

CommuniG8 commented 2 weeks ago

Describe what you would like to know or do I'd like to be able to set the compression threshold to a lower value than the 1024 byte value in the PerMessageDeflateExtension.

Describe the solution you'd considered I've taken a copy of the 1.5.7 source code and changed the default threshold which does work but this is not ideal.

Additional context I'm sending messages which are a little smaller than 1024 bytes that I'd like to compress.

PhilipRoman commented 1 week ago

setThreshold should do what you want

CommuniG8 commented 1 week ago

Could you give an example of using that method please?