SendComand doesn't work with large payload

I’m trying to use SendCommand function with a payload of around 500 kB. When I do this, the Jitsi connection seems to disconnect giving the following error: Websocket closed unexpectedly

If I make the payload much smaller the SendCommand function works without problems, so it seems to me there is some kind of limit how large the payload can be, and if so, are there any configs that can be changed to allow large payload? Or are there any alternative ways to send data to conference participants?

Yep, there is a default limit in prosody and it depends on your deployment. You should not send such large amount of data through xmpp presences (the way send command works). This method is intended for commands, not for data transfer.

What is the data you transfer? There is no channel other than the media one that is intended to transport such an amount of data.

I’m trying to send images (video frames) through SendCommand.

That’s not the proper channel for it. Use an endpoint message instead.

@Petelius how often is this happening? Is that broadcasted to all participants?

This happens every time when I send more than 3 commands using SendCommand. It’s broadcasted to all participants, but this is not required. It would be even better if the data can be sent to just single participant.

Thanks for the tip. I tried sendEndpointMessage, this seems to work but it gives error messages: Channel closed: 1009 Text message too large: (actual) 67,362 > (configured max text message size) 65,536

How do I increase the max text message size? There should be a config for it somewhere?

I believe that is in the JVB config. You should really be sending smaller chunks.

I looked the JVB config here: jitsi-videobridge/reference.conf at master · jitsi/jitsi-videobridge · GitHub

And found these two configs:

I doubled those values but still I’m getting error message: Channel closed: 1009 Text message too large: (actual) 70,908 > (configured max text message size) 65,536

I wonder what is the correct config I should increase from the JVB config…

This is a jetty thing:

You need somehow configure it for jetty or do a code change for that …

Anyway, that size of data in json messages over the WebSocket can cause performance issues to jvb and quality may suffer …

1 Like