title: Websocket on firefox webgl
body: <p>I have an issue with my game. I am working on a game in Unity3D 5, in WebGL. The game connect to a server using web socket with an address that looks like this:</p>
  
  <blockquote>
    <p>wss://serveraddress:8443/moreaddress  </p>
  </blockquote>
  
  <p>It is using a javascript implementation to connect to the server. The javascript looks like this :</p>
  
  <pre><code>var WSClient = {
      socket: null,
      url: null,
  
      connect: function(host) {
          if ('WebSocket' in window) {
              this.socket = new WebSocket(host);
          } else if ('MozWebSocket' in window) {
              this.socket = new MozWebSocket(host);
          } else {
              Console.log('Error: WebSocket is not supported by this browser.');
              return;
          }
  
          this.socket.onopen = function()
          {
              SendMessage("WebSocketManager","OnOpenWebSocket");
          };
  
          this.socket.onclose = function() {
              SendMessage("WebSocketManager","OnCloseWebSocket");
          };
  
          this.socket.onmessage = function(message) {
              if(typeof message == "string"){
                  SendMessage('WebSocketManager','OnMessageReceived', message);
              }
          };
      },
  
      initialize: function(url) {
          if (typeof url !== "undefined")
              this.url = url;
  
          if (this.url == null) {
              Console.log('Info: Initialize without an URL');
              return;
          }
  
          this.connect(this.url);
      },
  
      sendMessage: function(msg) {
          if (msg != '') {
              this.socket.send(msg);
          }
      },
  
      close: function() {
          this.socket.close();
      }
  };
  </code></pre>
  
  <p>The SendMessage function is just something to call a function in Unity. So basically what is happening to me is after my game connect to the server, the <code>onOpen()</code> function gets called, then calls my <code>OnOpenWebSocket()</code> function from Unity, which then tries to send a message to the server to login, the server receives the message and attempts to send me an answer, but all I am getting in my <code>onMessage()</code> function is this message : <code>{"isTrusted":true}.</code></p>
  
  <p>This happens on Firefox, but works perfectly fine on Chrome. On Chrome I am getting the right message from my server. And there is nowhere in the server a place where <code>isTrusted</code> is written.</p>
  
  <p>I am using Firefox 33.0. And Chrome 39.0.2171.95</p>
  
  <p>I looked in the <code>about:config</code> of firefox, and the <code>websocket</code> are enabled.</p>
  
  <p>Anyone has an idea on what could cause this?</p>