title: How to send binary data with socket.io?
body: <p>so I have been having real trouble sending binary data with socket.io  in node.js (Js client and Android client). </p>
  
  <p>There is not much information neither in:</p>
  
  <p><a href="http://socket.io/blog/introducing-socket-io-1-0/" rel="noreferrer">http://socket.io/blog/introducing-socket-io-1-0/</a></p>
  
  <p><a href="http://socket.io/get-started/chat/" rel="noreferrer">http://socket.io/get-started/chat/</a></p>
  
  <p>I need to use socket io to send a binary array, that I create and fill.</p>
  
  <p>the only code they give is the following:</p>
  
  <pre><code>var socket = new WebSocket('ws://localhost');
  socket.binaryType = 'arraybuffer';
  socket.send(new ArrayBuffer);
  </code></pre>
  
  <p>My answer is bellow.</p>