title: php ratchet websocket SSL connect?
body: <p>I have a ratchet chat server file</p>
  
  <pre><code>use Ratchet\Server\IoServer;
  use Ratchet\WebSocket\WsServer;
  use MyAppChat\Chat;
  require dirname(__DIR__) . '/vendor/autoload.php';
  $server = IoServer::factory(
      new WsServer(
          new Chat()
      )
    , 26666
  );
  $server-&gt;run();
  </code></pre>
  
  <p>I using Websocket to connect with <code>ws</code> and it works fine</p>
  
  <pre><code>if ("WebSocket" in window) {
      var ws = new WebSocket("ws://ratchet.mydomain.org:8888");
      ws.onopen = function() {
          // Web Socket is connected. You can send data by send() method.
          ws.send("message to send");
      };
      ws.onmessage = function (evt) { 
          var received_msg = evt.data;
      };
      ws.onclose = function() { 
          // websocket is closed. 
      };
  } else {
    // the browser doesn't support WebSocket.
  }
  </code></pre>
  
  <p>I want secure connection, so I try to connect with SSL but is not work.</p>
  
  <pre><code>if ("WebSocket" in window) {
      var ws = new WebSocket("wss://ratchet.mydomain.org:8888");
      ws.onopen = function() {
          // Web Socket is connected. You can send data by send() method.
          ws.send("message to send");
      };
      ws.onmessage = function (evt) { 
          var received_msg = evt.data;
      };
      ws.onclose = function() { 
          // websocket is closed. 
      };
  } else {
    // the browser doesn't support WebSocket.
  }
  </code></pre>
  
  <p>My question is <strong>how to connect websocket with SSL connection</strong></p>
  
  <p>Any idea?</p>