title: How to setup WebSocket Secure connection with PHP?
body: <p>I can't find any information about setting up a wss connection in PHP.
  I have no problem to be connected throw ws. I'm using this pretty great library to do this by the way: <a href="https://github.com/albeva/php-websocket" rel="noreferrer">https://github.com/albeva/php-websocket</a></p>
  
  <p>But my website use https and I need a WebSocket Secure connection to avoid Firefox to complain about the fact that the connection is insecure.</p>
  
  <p>Thanks in advance for your help.</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is the code used by the library to start the socket connection:</p>
  
  <pre><code>$master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
  if (!is_resource($master)) {
      $this-&gt;throwSocketError();
  }
  
  // set options
  if (!socket_set_option($master, SOL_SOCKET, SO_REUSEADDR, 1)) {
      $this-&gt;throwSocketError();
  }
  
  // bind
  if (!socket_bind($master, $this-&gt;host, $this-&gt;port)) {
      $this-&gt;throwSocketError();
  }
  
  // listen for connections
  if (!socket_listen($master, SOMAXCONN)) {
      $this-&gt;throwSocketError();
  }
  </code></pre>
  
  <p>I believe I need to change this code but I can't find how.</p>