title: How to run websocket alongside laravel webpage in cPanel?
body: <p>I have the Laravel project with websocket. I cloned the project on server with cPanel. Now I can access the running Laravel project through a sub domain like <a href="https://app.example.com" rel="nofollow noreferrer">https://app.example.com</a>. But I can not able to use the websocket with that domain name, because time out.</p>
  
  <p>The websocket which I using is <code>wss</code>. I used the following command to run the websocket : <code>php artisan websocketsecure:init</code>. The command is running successfully, but I can't able to use. I tried the following address <code>wss://app.example.com:8090</code></p>
  
  <p>How can I access the secure websocket in the Laravel project?
      
  
  <pre><code>namespace App\Console\Commands;
  
  use Illuminate\Console\Command;
  use Ratchet\Server\IoServer;
  use Ratchet\Http\HttpServer;
  use Ratchet\WebSocket\WsServer;
  use React\EventLoop\Factory;
  use React\Socket\SecureServer;
  use React\Socket\Server;
  use App\Http\Controllers\WebSocketController;
  
  class WebSocketSecureServer extends Command
  {
      /**
       * The name and signature of the console command.
       *
       * @var string
       */
      protected $signature = 'websocketsecure:init';
  
      /**
       * The console command description.
       *
       * @var string
       */
      protected $description = 'Command description';
  
      /**
       * Create a new command instance.
       *
       * @return void
       */
      public function __construct()
      {
          parent::__construct();
      }
  
      /**
       * Execute the console command.
       *
       * @return mixed
       */
      public function handle()
      {
          $loop   = Factory::create();
          $webSock = new SecureServer(
              new Server('0.0.0.0:8090', $loop),
              $loop,
              array(
                  'local_cert'        =&gt; '/apache/conf/ssl.crt/server.crt', // path to your cert
                  'local_pk'          =&gt; '/apache/conf/ssl.key/server.key', // path to your server private key
                  'allow_self_signed' =&gt; TRUE, // Allow self signed certs (should be false in production)
                  'verify_peer' =&gt; FALSE
              )
          );
          // Ratchet magic
          $webServer = new IoServer(
              new HttpServer(
                  new WsServer(
                      new WebSocketController()
                  )
              ),
              $webSock
          );
          $loop-&gt;run();
      }
  }
  </code></pre>