I have a Spring Boot server that I would like to be able to communicate with websocket clients that are unable or unwilling to handle permessage-deflate compressed messages. I know from both of these similar questions on the topic (linked below) that I can add the VM argument -Dorg.apache.tomcat.websocket.DISABLE_BUILTIN_EXTENSIONS=true to disable Tomcat's default deflate compression.
- Tomcat JSR356 Websocket - disable permessage-deflate compression
- Spring disable websocket compression -> Sec-WebSocket-Extensions: permessage-deflate
However, I plan to make a program that will be distributed so others can run it, and having to force people to remember to always include a specific VM argument just to change a setting seems quite abrasive.
Is there some alternative way to disable Tomcat's websocket compression which doesn't require users to specify VM arguments at runtime, perhaps using Spring's Java configuration or a custom websocket handshake interceptor?