You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that when I pass binary data to socket.io's emit function, that data is transformed in place. For example, File objects become ArrayBuffer objects. It makes sense why this needs to happen, but would it be possible to generate a modified copy of the data for transmission instead of mutating it in place?
As it is now, I find myself defensively deep cloning anything I pass to socket.io which is actually kind of hard to do well (JSON encoding and parsing leads to bugs, structured clone would be great but isn't exposed by browsers, circular references create issues, etc).
Thanks for the great software, btw.
The text was updated successfully, but these errors were encountered:
darrachequesne
added a commit
to darrachequesne/engine.io-parser
that referenced
this issue
Oct 31, 2018
Apologies if this is the wrong repo for this.
I have noticed that when I pass binary data to socket.io's emit function, that data is transformed in place. For example, File objects become ArrayBuffer objects. It makes sense why this needs to happen, but would it be possible to generate a modified copy of the data for transmission instead of mutating it in place?
As it is now, I find myself defensively deep cloning anything I pass to socket.io which is actually kind of hard to do well (JSON encoding and parsing leads to bugs, structured clone would be great but isn't exposed by browsers, circular references create issues, etc).
Thanks for the great software, btw.
The text was updated successfully, but these errors were encountered: