private function loadConnections(ContainerBuilder $container, array $config)
    {
        $factoryName = $this->addFactoryToContainer($container);
        $genericDefinition = new Definition(Publisher::class);
        $genericDefinition->setFactory([new Reference($factoryName), 'createPublisher']);

        foreach ($config['connections'] as $key => $connection) {
            $protocol = $connection['protocol'];
            $host = $connection['host'];
            $port = $connection['port'];
            $path = $connection['path'];
            $auth_key = $connection['auth_key'];
            $auth_secret = $connection['auth_secret'];
            $hostname = $connection['hostname'];
            $ignoreSsl = $connection['ssl_ignore'];

            if ($path[0] !== '/') {
                $path = '/' . $path;
            }

            $definition = clone $genericDefinition;
            $definition->setArguments([$protocol, $host, $port, $path, $auth_key, $auth_secret, $hostname, $ignoreSsl]);
            $definition->setPublic(true);
            $container->setDefinition(sprintf('facile.crossbar.publisher.%s', $key), $definition);
        }
    }