symfony - HTTPS 上的网络套接字

标签 symfony ssl nginx websocket

在本地服务器中我没有遇到这个问题,但是在具有 https 的生产服务器中它不起作用

Firefox ne peut établir de connexion avec le serveur à l’adresse 
wss://kergafa.com:8081/.

我已经尝试了很多次,但无法找到/理解问题出在哪里?

我的conf.yml

gos_web_socket:
   server:
      port: 8081 #The port the socket server will listen on
      host: kergafa.com #The host ip to bind to
      router:
         resources:
            - '@SkiesAdherentBundle/Resources/config/pubsub/routing.yml
   client:
      firewall: main
      session_handler: '@session.handler.pdo'
   pushers:
   wamp:
      host: kergafa.com
      port: 8081

当我启动服务器时:

[2017-01-06 04:33:12] websocket.INFO: Starting web socket
[2017-01-06 04:33:12] websocket.INFO: Register periodic callback Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing, executed each 20 seconds 
[2017-01-06 04:33:12] websocket.INFO: Launching Ratchet on kergafa.com:8081 PID: 7698

所以它的工作原理

ctunnel 配置

[websockets]
accept = 8080
connect = kergafa.com:8081

它说:

 [Started: /etc/stunnel/stunnel.conf] stunnel.

grep 8080 结果

tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 7694/stunnel4

最佳答案

我编辑了你的帖子。在 config.yml 中你有这个:

router:
   resources:
      - '@SkiesAdherentBundle/Resources/config/pubsub/routing.yml

但这看起来不对。我认为一个简单的改变:

router:
   resources:
      - @SkiesAdherentBundle/Resources/config/pubsub/routing.yml

也许这就是问题所在?

关于symfony - HTTPS 上的网络套接字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41498620/

相关文章:

.htaccess - 使 SSL/HTTPS 与 Symfony2 一起工作时遇到问题

php - Wordpress 站点同时为不同域的 http 和 https 提供服务

带有显式 TLS/SSL 的 PHP curl FTPes

nginx - Nginx仅显示欢迎页面

php - 错误 Symfony Doctrine PostgreSQL : SQLSTATE[42703]: Undefined column: 7 ERROR

performance - Symfony2 加载时间和性能

asp.net-mvc - 如何使用 Fluent Security 在 ASP.net MVC 应用程序中设置 SSL 重定向?

docker - 如何在端口443和80的Docker群中创建Nginx服务

ssl - Nginx 400 SSL 握手

php - 弄清楚如何配置特定的 services.yml 值 - Symfony2