I have big problem with setup communication over WSS with my application.
My current configuration:
- Debian Jessie
- Apache 2.4.10
JS important part
var c = new WebSocket('ws://my.host.local:1988');
- Ratchet PHP with server on port 1988
In this case everything works fine. But when I want to add wss there is error:
WebSocket opening handshake was canceled
I've read few old tutorials and I've add changes:
enable (a2enmod): proxy proxy_wstunnel
change JS part:
var c = new WebSocket('wss://my.host.local/wss2');
- change apache site conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName my.host.local
DocumentRoot /var/www/ws
<Directory /var/www/ws>
AllowOverride all
Order allow,deny
allow from all
</Directory>
ProxyRequests off
ProxyTimeout 15
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass "/wss2/" "ws://my.host.local:1988/"
</VirtualHost>
After this I still have the same error. When I've changed wss to ws in address it worked but it's very important to enable secure communication. In the future I will use this on https site so new Chrome requires wss.
What I'm doing wrong?