Hello guys,
I finally figured it out after taking a second look at things again.
Turns out it's pretty easy. You just have to use the Symfony componets for routing, something like this
$collection = new RouteCollection;
$collection->add('foo', new Route('/foo', array(
'_controller' => new Ratchet\WebSocket\WsServer(
new Ratchet\Wamp\WampServer(
new SocketServer\FooPusher
)
),
)));
$collection->add('bar', new Route('/bar', array(
'_controller' => new Ratchet\WebSocket\WsServer(
new Ratchet\Wamp\WampServer(
new SocketServer\BarPusher
)
),
'allowedOrigins' => '*'
)));
then declare a new router and wrap it in the httpserver class.
$router = new Ratchet\Http\Router(
new UrlMatcher($collection,
new RequestContext()
)
);
$webServer = new Ratchet\Server\IoServer(
new Ratchet\Http\HttpServer(
$router
),
$webSock
);
I think this is pretty simple, the only problem I had was calling the service with wamp2.0 protocol I don't think ratchet supports it.
If someone is falling to do this, feel free to post it here.
I might be able to help
Cheers
Francisco