I'm using socket.io v4.0.0 and socket.io-client v4.0.0 and I want to broadcast an image in base64 through the socket.io server.
Server side initialization code
this.io = new Server(httpServer, {
cors: {
origin: '*',
credentials: true
}
});
this.io.on('connection', (socket) => {
this.onConnection(socket);
});
Whenever I send an image in base64 with socket.emit('broadcastImage'. base64ImageData)
I'm having a Transport close
error and the client disconnect. I printed the data in the developper console and it says the data base64 is 1.7 Mb. Is there something with the new version of socket.io that limits the size of the data that can be sent or is it a timeout issue ? I tried to set a big pingtimeout
and pinginterval
value on the server side without success.
Edit: After several tests, it seems that below 1Mb it's fine, whenever the data is above 1Mb I have the Transport close
error