title: websocket php ratchet with server vps 2 from hostinger using centos operation
body: <ol>
  <li><p>hello all im try to make chat as real time im used websocket with
  php ratchet packege  and this my code : in my file server.php this
  code</p>
  <p>use Ratchet\Server\IoServer;
  use Ratchet\Http\HttpServer;
  use Ratchet\WebSocket\WsServer;
  use MyApp\Chat;</p>
  <pre><code>require dirname(__DIR__) . '/rat/autoload.php';
  
  $server = IoServer::factory(
      new HttpServer(
          new WsServer(
              new Chat()
          )
      ),
     8000
  );
  
  $server-&gt;run();
  </code></pre>
  </li>
  </ol>
  <p>also my secend file is a script js in  message.php :</p>
  <pre><code>      var conn = new WebSocket('ws://localhost:8000');                
      conn.onopen = function(e) {
      console.log(&quot;Connection established!&quot;);
      };
  </code></pre>
  <ol start="2">
  <li>please what i should to do   w://loclahost:8000 is correct ? or
  should i changed in my host name ? or domain name? or what</li>
  </ol>
  <blockquote>
  <p>secend qution what i should use port
  i had searched in google but i find more article that telk about httpd i cant f
  ind my answers please</p>
  </blockquote>