title: Websocket server in chrome packaged app
body: <p>Im building a websocket server in chrome packaged apps.
  I got everything working (handshake and recieving from client to server) but, when I try to send message from Server to Client it always get an error: "failed: A server must not mask any frames that it sends to the client."</p>
  
  <p>This is my prepareMessage code:</p>
  
  <pre><code>  var sendText = _toUTF8Array(JSON.stringify(msg) + '\n');
    var aa;
    var buffer;
    if (sendText.length &gt; 125) {
        if (sendText.length &lt; 65536) {
            aa = new ArrayBuffer(4 + sendText.length);
            buffer = new Uint8Array(aa);
            buffer[0] = 129;
            buffer[1] = 126;
            buffer[2] = sendText.length &gt;&gt; 8;
            buffer[3] = sendText.length &amp; 255;
            _arrayCopy(sendText, 0, buffer, 4, sendText.length);
        }
        else {
            aa = new ArrayBuffer(10 + sendText.length);
            buffer = new Uint8Array(aa);
            buffer[0] = 129;
            buffer[1] = 127;
            var len = new Uint8Array(8);
            len = _Uint64ToUint8(sendText.length);
            var tt = new Uint8Array(8);
            for (var i = 0; i &lt; 8; i++)
            {
                tt[7 - i] = len[i];
            }
            _arrayCopy(tt, 0, buffer, 2, 8);
            _arrayCopy(sendText, 0, buffer, 10, sendText.length);
        }
    }
    else {
        aa = new ArrayBuffer(2 + sendText.length);
        buffer = new Uint8Array(aa);
        buffer[0] = 129;
        buffer[1] = sendText.length;
        _arrayCopy(sendText, 0, buffer, 2, sendText.length);
    }
    return aa;
  </code></pre>