I have two problems:
1. When I send text or binary larger than 128 kb in Chrome, Chrome sends fragmented websocket frames. These frames should end with the last frame and fin=1. But Chrome is also sending Frames with unknown opcodes.
2. When I try to send large files in Firefox, then Firefox sends the data very slow in my home network(~300kb/s and slows down while sending TCP packages) and the file is never complete. Also the frame for the binary file is missing. I tracked the network with Wireshark. Safari chrashes by the same try.
I'm using Firefox 43.0.4 for Mac and Chrome 48.0.2564.97 for Mac Safari 9.0.3 And I'm using my own server in Node.js
UPDATE I found the problem but don't know the solution.
socket.on('data', function(data) {
buffer = Buffer.concat([buffer, data]);
_editBuffer();
});
Buffer.concat slows the transfer down. But how can I use the + operator for Buffer concatenation ?