I am trying to use websockets in binary mode to transfer binary data from a server written in Python to a client browser (javascript is working). I implemented this link in text mode, but now I want to improve performance by communicating in binary mode.
All the examples I've seen (like this , as well as if you are looking at the source code of matplotlib / webagg that Tornado uses) they use binary mode, but in fact they seem to encode raw binary data in UTF-8 (or base64) at some point before the transfer. In my opinion, this is not true binary translation, as it adds overhead from 30% to 50%.
So my question is: do I need to encode binary data in utf-8 or base64 in order to use IP based websites? If not, please indicate an example where this is done without encoding.
I have always believed that sockets support true binary communication, but perhaps this is not the case for IP networks for some reason. Perhaps someone can shed light on this issue. It seems that success in this area was achieved last year, which adds to the confusion.
source share