Unable to connect to my websocket service

  chat, symfony, websocket

I’ve a problem with my web socket service

Here’s my code about the service :


namespace AppCommand;

use SymfonyComponentConsoleCommandCommand;
use SymfonyComponentConsoleInputInputInterface;
use SymfonyComponentConsoleOutputOutputInterface;
use SymfonyComponentDependencyInjectionContainerInterface;

// Include ratcher libs
use RatchetServerIoServer;
use RatchetHttpHttpServer;
use RatchetWebSocketWsServer;

use AppSocketsChat; 

class ChatServerCommand extends Command
    protected $container;

    public function __construct(ContainerInterface $container)
        $this->container = $container;

    protected function configure()
        ->setHelp("Starts the chat socket")
        ->setDescription("Starts the chat socket");

    protected function execute(InputInterface $input, OutputInterface $output)
          'Chat socket',// A line
          '============',// Another line
          'Starting chat, open your browser.',// Empty line

        $server = IoServer::factory(
          new HttpServer(
            new WsServer(
              new Chat($this->container)

I start it on terminal with the start command :

php bin/console sockets:startchat

When I try to connect to the web socket from the browser, I’m directly disconnected

I don’t understand why…

Source: Symfony Questions