title: Client not receiving published events using demo code?
body: <p>I'm trying out Thruway and am having trouble getting the demo code to work.</p>
  
  <p>Javascript code:</p>
  
  <pre><code>&lt;script src="https://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  //    var autobahn = require('autobahn');
  
      var connection = new autobahn.Connection({url: 'ws://dev.mysite.com:9090/', realm: 'realm1'});
  
      connection.onopen = function (session) {
  
          // 1) subscribe to a topic
          function onevent(args) {
              console.log("Event:", args[0]);
          }
          session.subscribe('com.myapp.hello', onevent);
  
          // 2) publish an event
          session.publish('com.myapp.hello', ['Hello, world!']);
      };
  
      connection.open();
  &lt;/script&gt;
  </code></pre>
  
  <p>I have <code>SimpleWsServer.php</code> running:</p>
  
  <pre><code>&lt;?php
  
  require 'bootstrap.php';
  
  use Thruway\Peer\Router;
  use Thruway\Transport\RatchetTransportProvider;
  
  $router = new Router();
  
  $transportProvider = new RatchetTransportProvider("127.0.0.1", 9090);
  
  $router-&gt;addTransportProvider($transportProvider);
  
  $router-&gt;start();
  </code></pre>
  
  <p>I have <code>SimpleClient.php</code> running (I removed the RPC code since I only want to push messages from server to clients):</p>
  
  <pre><code>&lt;?php
  
  require 'bootstrap.php';
  
  use Thruway\ClientSession;
  use Thruway\Connection;
  
  $onClose = function ($msg) {
      echo $msg;
  };
  
  $connection = new Connection(
      [
          "realm"   =&gt; 'realm1',
          "onClose" =&gt; $onClose,
          "url"     =&gt; 'ws://127.0.0.1:9090',
      ]
  );
  
  $connection-&gt;on(
      'open',
      function (ClientSession $session) {
  
          // 1) subscribe to a topic
          $onevent = function ($args) {
              echo "Event {$args[0]}\n";
          };
          $session-&gt;subscribe('com.myapp.hello', $onevent);
  
          // 2) publish an event
          $session-&gt;publish('com.myapp.hello', ['Hello, world from PHP!!!'], [], ["acknowledge" =&gt; true])-&gt;then(
              function () {
                  echo "Publish Acknowledged!\n";
              },
              function ($error) {
                  // publish failed
                  echo "Publish Error {$error}\n";
              }
          );
  
  //        // 3) register a procedure for remoting
  //        $add2 = function ($args) {
  //            return $args[0] + $args[1];
  //        };
  //        $session-&gt;register('com.myapp.add2', $add2);
  //
  //        // 4) call a remote procedure
  //        $session-&gt;call('com.myapp.add2', [2, 3])-&gt;then(
  //            function ($res) {
  //                echo "Result: {$res}\n";
  //            },
  //            function ($error) {
  //                echo "Call Error: {$error}\n";
  //            }
  //        );
      }
  
  );
  
  $connection-&gt;open();
  </code></pre>
  
  <p>It looks to me like the demo code sends the message <code>Hello, world from PHP!!!</code> to the client after it subscribes, but I'm not seeing a message in my browser's console.</p>
  
  <p>I know the client is connecting to the server because <code>SimpleClient.php</code> outputs the following to the terminal:</p>
  
  <pre><code>2015-03-02T19:47:24.5464800 debug      [Thruway\Transport\PawlTransportProvider 13800] Received: [36,1574620859,33562629,{},["Hello, world!"]]
  2015-03-02T19:47:24.5470880 debug      [Thruway\Peer\Client 13800] Client onMessage: [Thruway\Message\EventMessage]
  Event Hello, world!
  </code></pre>
  
  <p>Am I missing something, or should <code>Hello, world from PHP!!!</code> have been printed out in the browser console?</p>