Ihsan Ratchet Bundle
Install
composer req ad3n/ratchet-bundle
Activating Bundle (Optional)
Add new Ihsan\RatchetBundle\IhsanRatchetBundle() in your AppKernel.php
Create Your Message Processor
<?php
namespace YourBundle\Message\Processor;
use Ihsan\RatchetBundle\Message\Message;
use Ihsan\RatchetBundle\Processor\MessageProcessorInterface;
use Ratchet\ConnectionInterface;
class MyOwnMessageProcessor implements MessageProcessorInterface
{
public function process(ConnectionInterface $connection, Message $message): Message
{
return $message;
}
}
Create Service
You must add tag ihsan_ratchet.message_processor to register your own message processor
YourBundle\Message\Processor\MyOwnMessageProcessor:
tags:
- { name: 'ihsan_ratchet.message_processor' }
Add Configuration Key
WEB_SOCKET_PORT=7777
or
ihsan_ratchet:
web_socket_port: 7777
Start Server
Run php bin/console ihsan:server:start