Websocket connection error

You k5 years ago

Hi all,
after installing an ssl certificate and starting using https connection i noticed that the traccar doesn't update position and didn't send events it shows this error msg : websocket connection error
developer console on chrome shows : WebSocket connection to 'wss://cloud.localisermoi.com/api/socket' failed: Error during WebSocket handshake: Unexpected response code: 405
please any insights would be appreciated

below my virtual host :

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>

                ServerName mydomaine.com
                ServerAdmin admin@mydomaine.com

                DocumentRoot /var/www/html

                ProxyPass /api/socket ws://mydomaine.com/api/socket
                ProxyPassReverse /api/socket ws://mydomaine.com/api/socket


                ProxyPass / http://mydomaine:8082/
                ProxyPassReverse / http//mydomaine:8082/

                SSLEngine on
                SSLProxyEngine on
                ProxyRequests Off
                RewriteEngine on
                RewriteCond %{HTTP:UPGRADE} =WebSocket [NC]
                RewriteRule .* ws://mydomaine.com:8082%{REQUEST_URI} [P]
                SSLCertificateFile /etc/ssl/certs/mydomaine_com.crt
                SSLCertificateKeyFile /etc/ssl/private/mydomaine_com.key
                SSLCACertificateFile /etc/ssl/certs/mydomaine.ca-bundle


        </VirtualHost>
</IfModule>
Jasiel Izaguirre5 years ago

If you follow these instructions step by step, it should work.

https://www.traccar.org/secure-connection/

You k5 years ago

Hi, i've already tried those instructions but doesn't work