title: Error 1006 on websocket
body: <p>I am getting error 1006 on my Web-socket API. I have two machines, and code works fine in one and in the second one I get 1006 error when I send a message from my back-end server.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var ws = new WebSocket("ws://localhost:8080/handler");
  
  ws.onopen = function()
  {
    ws.send("Message send");
    alert("Connection success...");
  };
  
  ws.onmessage = function (evt) 
  { 
    var received_msg = JSON.parse(evt.data);
  };
  
  ws.onerror = function(e){};
  
  ws.onclose = function(er)
  { 
    alert("Connection is closed..."); 
  };
  </code></pre>