This bundle allows to submit PubSub events via HTTP/POST requests to a Crossbar HTTP Publisher.

1.0.3 2017-12-20 13:14 UTC

This package is auto-updated.

Last update: 2021-12-31 00:23:04 UTC


Stable release Unstable release Build status

Coverage Status Scrutinizer SL Insight

This bundle allows to submit PubSub events via HTTP/POST requests to a Crossbar HTTP Publisher, which is a simple, lightweight websocket server implemented in Python.


  • Define multiple publishers
  • Publishers are automatically registered into Syomfony's service container
  • Send signed requests easily
  • Skip SSL certificate verification (useful in dev environment)


  • PHP >=5.6
  • Guzzle 5 or 6
  • The following Symfony components (or the full-stack framework), version 2.7, 2.8, 3.x or 4.x:
    • symfony/framework-bundle
    • symfony/dependency-injection
    • symfony/config


Require this package with Composer:

$ composer require facile-it/crossbar-http-publisher-bundle

... and register the bundle in your app (usually in app/AppKernel.php)

public function registerBundles()
    return array(
        // ...
        new Facile\CrossbarHTTPPublisherBundle\FacileCrossbarHTTPPublisherBundle(),


You just need to configure the publishers that you need to use; here is an example of the config, with the default values:

      protocol: https                     #default: http
      host: crossbar.io                   #default: 
      port: 443                           #default: 8080
      path: publish                       #default: publish, often just empty
      auth_key: this_is_very_key          #default: null
      auth_secret: this_is_very_secret    #default: null
      ssl_ignore: true                    #default: false
      host: crossbar.tu


Once you've done that, the publishers will be available as Symfony services in your container:

$firstPublisher = $container->get('facile.crossbar.publisher.dummy_publisher_1');
$secondPublisher = $container->get('facile.crossbar.publisher.dummy_publisher_2');

$topic = 'com.myapp.topic1';

// using args
$firstPublisher->publish($topic, ['foo',1]);

// using kwargs
$secondPublisher->publish($topic, null, ['key'=>'value']);

// using both and printing Crossbar's response already decoded:
print_r($firstPublisher->publish($topic, ['foo',1], ['key'=>'value']));

// ouptuts:
// array(1) {
//   ["id"]=>
//   int(1395572605)
// }