PHP Ratchet Websocket Server With Apache2 Not Working
by Mental-Octopus from LinuxQuestions.org on (#6DDVP)
I have a websocket server written in php, it's the Ratchet websocket server.
I enabled wstunnel for apache. I also added ProxyPass in my website configuration
<VirtualHost *:443>
DocumentRoot /var/www/mywebsite/pav/
ServerName www.mywebsite.com
ServerAlias mywebsite.com
RewriteEngine on
ProxyPass /wss2/ ws://www.mywebsite.com:8080
<Directory /var/www/mywebsite/pav/>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
My website is written php and JS.
In javascript the script I used to connect to the server is
var socket = new WebSocket('wss://www.mywebsite.com:8080');
I checked in my browser (Firefox) using inspect and in the console it says:
Firefox canit establish a connection to the server at wss://www.xpatvoice.com:8080/.
I've tried other browsers and got the same result.
The thing is I don't know how to tell what's causing it to fail,
I mean any error code or error log to diagnose the problem.
I also tried
var socket = new WebSocket('wss://www.mywebsite.com/wss2/:8080');
I enabled wstunnel for apache. I also added ProxyPass in my website configuration
<VirtualHost *:443>
DocumentRoot /var/www/mywebsite/pav/
ServerName www.mywebsite.com
ServerAlias mywebsite.com
RewriteEngine on
ProxyPass /wss2/ ws://www.mywebsite.com:8080
<Directory /var/www/mywebsite/pav/>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
My website is written php and JS.
In javascript the script I used to connect to the server is
var socket = new WebSocket('wss://www.mywebsite.com:8080');
I checked in my browser (Firefox) using inspect and in the console it says:
Firefox canit establish a connection to the server at wss://www.xpatvoice.com:8080/.
I've tried other browsers and got the same result.
The thing is I don't know how to tell what's causing it to fail,
I mean any error code or error log to diagnose the problem.
I also tried
var socket = new WebSocket('wss://www.mywebsite.com/wss2/:8080');