title: PHP ratchet trouble with SSL
body: <p>I can't seem to connect ratchet now that my website uses https. I even have <strong>stunnel</strong> installed. Here is my configuration</p>
  
  <p>Demo: <a href="https://usyd.chat/react.html" rel="nofollow">https://usyd.chat/react.html</a> (see source code and console)</p>
  
  <p>push-server.php </p>
  
  <pre><code>&lt;?php
  require dirname(__DIR__) . '/vendor/autoload.php';
  
  $loop   = React\EventLoop\Factory::create();
  $pusher = new Unichat\Pusher;
  
  // Listen for the web server to make a ZeroMQ push after an ajax request
  $context = new React\ZMQ\Context($loop);
  $pull = $context-&gt;getSocket(ZMQ::SOCKET_PULL);
  $pull-&gt;bind('tcp://103.4.16.217:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
  $pull-&gt;on('message', array($pusher, 'onInterfere'));
  
  // Set up our WebSocket server for clients wanting real-time updates
  $webSock = new React\Socket\Server($loop);
  $webSock-&gt;listen(8080, '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect
  $webServer = new Ratchet\Server\IoServer(
      new Ratchet\Http\HttpServer(
          new Ratchet\WebSocket\WsServer(
              new Ratchet\Wamp\WampServer(
                  $pusher
              )
          )
      ),
      $webSock
  );
  
  $loop-&gt;run();
  </code></pre>
  
  <p>Here is how I'm connecting to my web socket</p>
  
  <pre><code>var conn = new ab.Session('wss://usyd.chat:8080')
  </code></pre>
  
  <p>Finally, my stunnel config</p>
  
  <pre><code>output = /etc/stunnel/stunnel.log
  
  [websockets]
  #cert = /etc/ssl/crt/primary.crt
  cert = /etc/stunnel/stunnel.pem
  accept = 8443
  connect = 8080
  </code></pre>
  
  <p>Nothing happens when I go on the react.html page on the console. In my pusher class, i have</p>
  
  <pre><code>echo "connected"
  </code></pre>
  
  <p>in the onOpen method too but it doesn't log anything in the console. </p>
  
  <p>Any help would be most appreciated.
  Thanks</p>