php ratchet websocket SSL connect?

后端 未结 9 2223
遥遥无期
遥遥无期 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条回答
  •  猫巷女王i
    2020-11-27 03:51

    It is working for me for ubuntu 18.04.

    var ws = new WebSocket('wss://domain.com/ws/');

    Enabled proxy modules by running the following command in terminal.

    sudo a2enmod proxy proxy_balancer proxy_wstunnel proxy_http

    Added these lines in my Apache virtualhost config file(/etc/apache2/sites-available/000-default-le-ssl.conf)

    ProxyRequests Off

    ProxyPass "/ws/" "ws://domain.com:5555/"

    Restarted apache service. And the websocket started working in https.

提交回复
热议问题