mspanc
mspanc

Reputation: 550

How to limit in netty length of websocket frame received by server

I am implementing a WebSocket service using netty 3.4.

I need to limit the frame size to avoid DoS attacks with very very long frames. I want the connection to be dropped after 32KB of data, even if the frame was not finished yet and it was not passed to my Handler.

Is there any way to do that?

Upvotes: 1

Views: 1667

Answers (1)

Veebs
Veebs

Reputation: 2388

Given the code as it stands at the moment, doesn't look like it at the moment.

You will have to extend WebSocket08FrameDecoder and change the code in toFrameLength().

If I get a chance, I'll put in a pull request for the next release.

Upvotes: 2

Related Questions