Create Websocket

Discussion in 'Installation/Configuration' started by senormedia, Apr 23, 2022.

  1. senormedia

    senormedia Member HowtoForge Supporter

    I have ratchet on a site and cannot connect
    I opened a port on the firewall settings but it does not work or get a console log
    i followed this instructions
    Am i missing something

    I have both nginx and apache server
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    What do you mean by having both nginx and apache server?
  3. senormedia

    senormedia Member HowtoForge Supporter

    Solution for Apache

    Make sure you have

    Open port you want on firewall
    Create Regular website on ispconfig
    Go to Apache Directives and add a proxy
    ProxyPass /wss2/ ws://
    ProxyPassReverse /wss2/ ws://

    replace domain and port with whatever you created and opened

    Go to command prompt and run php server.php where ratchet is located

    then you can test with js
    var conn = new WebSocket("wss://");
    conn.onopen = function (e) {
    console.log("Connection established!");
    ahrasis likes this.

Share This Page