php ratchet websocket SSL connect?

后端 未结 9 2213
遥遥无期
遥遥无期 2020-11-27 03:30

I have a ratchet chat server file

use Ratchet\\Server\\IoServer;
use Ratchet\\WebSocket\\WsServer;
use MyAppChat\\Chat;
require dirname(__DIR__) . \'/vendor/         


        
9条回答
  •  野性不改
    2020-11-27 03:52

    The problem is that React (which Ratchet is built on) does not support direct SSL connections. See this issue.

    There is a simple workaround. Use stunnel with a config like:

    [websockets]
    accept = 8443
    connect = 8888
    

    Stunnel will handle SSL traffic on port 8443 and port them to your websocket server.

提交回复
热议问题