title: Ratchet PHP: Bind to different port than 127.0.0.1:5555
body: <p>I have a websocket server written with ratchet and it works well when it is bound to 127.0.0.1:5555. However, i need to run an additional instance of the script on the same machine, so i tried to create another instance bound to a different port, but then clients can connect and subscribe to a topic, yet they don't receive any data that is supposed to be pushed over the connection. I tried many different ports and even different loopbacks (127.0.0.1/8) but the only thing that seems to work is 127.0.0.1:5555. How do i get other ports or loopbacks to work?</p>
  
  <p><strong>Instance #1</strong>, which works:</p>
  
  <pre><code>// 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('127.0.0.1:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
  $pull-&gt;on('message', array($pusher, 'onUpdate'));
  
  // 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><strong>Instance #2</strong>, bound to another port, which does not work:</p>
  
  <pre><code>// 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('127.0.0.1:4444'); // Binding to 127.0.0.1 means the only client that can connect is itself
  $pull-&gt;on('message', array($pusher, 'onUpdate'));
  
  // Set up our WebSocket server for clients wanting real-time updates
  $webSock = new React\Socket\Server($loop);
  $webSock-&gt;listen(9090, '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>