title: Failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
body: <p>I try to connect with socket to my server.
  My server is running server socket with Rachet on port 8080.
  I try to run this code:</p>
  
  <pre><code>&lt;script&gt;   
  
      try{
      conn = new WebSocket('wss://localhost:8080');
  
  
  conn.onclose = function (e)
  {
          //checkUser();
  }
  
  conn.onopen = function(e) 
  {
      console.log("test");
  };
  
      }catch (error)
  {
      console.log(error);
  }
  
    &lt;/script&gt;
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>WebSocket connection to 'wss://localhost:8080/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>When I try to connect from my linux shell I get this:</p>
  
  <pre><code>root@(none):~# telnet localhost 8080
  Trying ::1...
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  </code></pre>