WebSocketBundle: Problem with share session.

Hello I try to share sesssion by this tutorial: https://github.com/GeniusesOfSymfony/WebSocketBundle/blob/master/Resources/docs/SessionSetup.md

My configuration:

# Web Socket Configuration
gos_web_socket:
    server:
        port: 8080        #The port the socket server will listen on
        host: 0.0.0.0   #The host ip to bind to
        router:
            resources:
                - @AppChatBundle/Resources/config/pubsub/routing.yml
    client:
        firewall: secured_area
        session_handler: @session.handler.pdo
        storage:
            driver: @gos_web_socket.client_storage.driver.predis
            decorator: @gos_web_socket.client_storage.doctrine.decorator

# Doctrine cache        
doctrine_cache:
    providers:
        redis_cache:
            redis:
                host: 127.0.0.1
                port: 6379
                database: 3
        websocket_cache_client:
            type: redis
            alias: gos_web_socket.client_storage.driver.redis         
# SNC           
snc_redis:
    clients:
        ws_client:
            type: predis
            alias: client_storage.driver #snc_redis.client_storage.driver
            dsn: redis://127.0.0.1/2
            logging: %kernel.debug%
            options:
                profile: 2.2
                connection_timeout: 10
                read_write_timeout: 30

ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58: The service “gos_web_scocket.client_storage.driver.predis” has a dependency on a non-existent service “snc_redis.cache”.

I’ve installed SNC and Redis Bundle.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 37 (15 by maintainers)

Most upvoted comments

I also removed DoctrineCacheBundle and SncRedis. Default is the best. 😄

Sure. Use it when you’ll have 1000 concurrent users 💃

If the session is not shared it’s due to your domain.

The domain between your websocket must be the same as your website. Because we use the cookie to auth the user.

Some examples :

Webserver | Websocket 127.0.0.1:80 | 127.0.0.1:8080 -> WORK 127.0.0.1:80 | localhost:8080 -> NOT WORK my-app.dev:80 | my-app.dev:8080 -> WORK my-app.dev:80 | 127.0.0.1:8080 -> NOT WORK

I hope that will help you.