【发布时间】:2018-04-27 02:01:44
【问题描述】:
将 GeniusesOfSymfony/WebSocketBundle 与
一起使用 Symfony configuration
framework:
session:
handler_id: session.handler.native_file
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
Bundle configuration
gos_web_socket:
server:
port: 8443
host: 127.0.0.1
router:
resources:
- "%kernel.root_dir%/../src/AppBundle/Resources/config/pubsub/routing.yml"
client:
firewall: main
session_handler: "@session.handler.native_file"
topics:
- "@o4sh_socket.topic_chat"
pushers:
wamp:
host: 127.0.0.1
port: 8443
Firewall configuration
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
default_target_path: app_homepage
always_use_default_target_path: false
logout: true
anonymous: true
switch_user: {role: user.switch_user} #use role rights
连接到 websocket 服务器时产生错误
2017-11-14 07:52:25] websocket.ERROR:发生连接错误警告:SessionHandler::read():会话在 /srv/www/karli/vendor/symfony/symfony/src/ 中不活动Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php 第 61 行 {"connection_id":635,"session_id":"14425940785a0aa0b983236618314789"}
[2017-11-14 07:52:25] websocket.ERROR:发生连接错误警告:SessionHandler::read():会话在 /srv/www/karli/vendor/symfony/symfony/src 中不活动/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php 第 61 行 {"connection_id":635,"session_id":"14425940785a0aa0b983236618314789"}
[2017-11-14 07:52:25] websocket.ERROR:发生连接错误注意:未定义的属性:/srv/www/karli/vendor/gos/web-socket-bundle/中的stdClass::$clientStorageId Server/App/WampApplication.php 第 136 行 {"connection_id":635,"session_id":"14425940785a0aa0b983236618314789"}
[2017-11-14 07:52:25] websocket.ERROR:发生连接错误注意:未定义的属性:/srv/www/karli/vendor/gos/web-socket-bundle/中的stdClass::$clientStorageId Server/App/WampApplication.php 第 136 行 {"connection_id":635,"session_id":"14425940785a0aa0b983236618314789"}
更详细的错误:
【问题讨论】:
标签: php symfony session websocket ratchet