Reputation: 70
I'm using:
And I would like to compress the returned payload with "GZIP" (or any other compression). I've tried with the configuration in application.yml:
server.compression.enabled: true
But the payload returned is still in plain text.
Does anybody know how to resolve this? Thanks.
Upvotes: 3
Views: 1605
Reputation: 59086
The server.compression.enabled
configuration property is about HTTP response compression, so this won't achieve the desired goal.
With WebSocket, you can activate per-message compression with a protocol extension, it it is supported by the container you've chosen. This has to be negotiated between the client and the server during the handshake using the Sec-WebSocket-Extensions
. So in your case, activating it is not enough you need to enable that on the client as well. See rfc7692.
Some containers (like Jetty in recent versions) are enabling those compression extensions by default. In the case of Reactor Netty, I'm not sure this is the case.
For the next steps, you can:
WebSocketServerCompressionHandler
?)I've created reactor/reactor-netty#507.
Upvotes: 2