title: Read string from ArrayBuffer received via websocket
body: <p>I am using python <a href="https://github.com/dpallot/simple-websocket-server" rel="nofollow">SimpleWebSocketServer</a>, with a modified <code>SimpleExample.py</code> and Chrome.</p>
  
  <p>Everything works fine when I send strings from browser to python, but when I send string from python to browser, I don't have the faintest idea how to transform the received ArrayBuffer (or Blob, if configured so) into a javascript string.</p>
  
  <p>Python code:</p>
  
  <pre><code>def handleConnected(self):
      with open("roads.txt") as roadsfile:
          content = "" + roadsfile.read()
          self.sendMessage(content)
  </code></pre>
  
  <p>Browser code:</p>
  
  <pre><code>    function doConnect() {
          websocket = new WebSocket("ws://localhost:8000/");
          websocket.binaryType = 'arraybuffer';
          websocket.onmessage = function(event) { onMessage(event) };
      }
  
      function onMessage(event) {
          console.log(event.data);
      }
  </code></pre>
  
  <p>And what's get logged is just <code>ArrayBuffer{}</code>, appearing to be empty, I guess.</p>
  
  <p>I don't know what to do with this ArrayBuffer, neither how to check for its validity.</p>
  
  <p>By the way, the file content from <code>roads.txt</code> is one long line of text-based floats, similar to .csv, so if I could encode them as an actual binary array, the better!</p>