Websocket 65536 Maximum Frame Length Exceeded

In my scala application, I use web sockets to receive requests and send responses. When I try to pass a base64 string through web sockets, the following exception occurs

org.jboss.netty.handler.codec.frame.CorruptedFrameException: Max frame length of 65536 has been exceeded. 

I tried the solution below to fix my problem.

 export SBT_OPTS="-Xms1024m -Xmx3084m -XX:MaxPermSize=1024m -Dhttp.netty.maxInitialLineLength=2621440" 

This works well on Mac OS. But when I try to use the same solution in my windows (with modified export for installation) and with the Ubuntu machine, it does not work. I get the same exception message. Please help me fix this problem. thanks in advance

+5
source share
2 answers

The default buffer size set for the web socket is "65536". Therefore, you must increase the size of the websocket buffer in the application.conf file.

You can set the limit as below.

 play.websocket.buffer.limit=2621440 
+4
source

Find a way to increase the maximum size of WebSocket frames. For example, in Java, Session. setMaxTextMessageBufferSize(int) Session. setMaxTextMessageBufferSize(int) and Session. setMaxBinaryMessageBufferSize(int) Session. setMaxBinaryMessageBufferSize(int) .

+2
source

Source: https://habr.com/ru/post/1234105/


All Articles