title: How to run Ratchet remotely or on a server?
body: <p>Everything works fine on my local machine on XAMPP. But after I uploaded the files to a server, it gives a error like this...</p>
  
  <pre><code>Fatal error: Uncaught exception 'React\Socket\ConnectionException' with message 'Could not bind to tcp://0.0.0.0:8080: Address already in use' in 
  /home/sites/jemaottest.com/public_html/websocket/vendor/react/socket/src/Server.php:29 Stack trace: #0 
  /home/sites/jemaottest.com/public_html/websocket/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php(70): React\Socket\Server-&gt;listen(8080, '0.0.0.0') #1 
  /home/sites/jemaottest.com/public_html/websocket/bin/chat-server.php(17): Ratchet\Server\IoServer::factory(Object(Ratchet\Http\HttpServer), 8080, '0.0.0.0') #2 {main} thrown in 
  /home/sites/jemaottest.com/public_html/websocket/vendor/react/socket/src/Server.php on line 29
  </code></pre>
  
  <p>when I run the chat-server.php file.</p>
  
  <p>I found out something on the troubleshooting page of Ratchet which says,</p>
  
  <blockquote>
    <p>If you want to open Ratchet up (not behind a proxy) set the third parameter of App to '0.0.0.0'.</p>
  </blockquote>
  
  <p>I tried that but it didn't work,</p>
  
  <pre><code>&lt;?php 
  use Ratchet\Server\IoServer;
  use Ratchet\Http\HttpServer;
  use Ratchet\WebSocket\WsServer;
  use MyApp\Chat;
  
  require dirname(__DIR__).'/vendor/autoload.php';
  
  $server = IoServer::factory(
      new HttpServer(
          new WsServer(
              new Chat()
          )
      ),
      8080,
      '0.0.0.0'
  );
  
  $server-&gt;run();  
  ?&gt;
  </code></pre>
  
  <p>it still gave the same error.</p>
  
  <p>What should I do now?</p>