Laravel Echo Server and Socketio With ProxyPass dont work

  apache, laravel, laravel-echo, php,

i have an aplication with laravel 8 and php 7.4. I use laravel broadcasting to send notifications to cliens, with redis, laravel-echo-server and socketio. All is working perfect, but i need to make with a proxypass in my public server and i cant get it to work.
Without the proxypass all is working perfect, i have laravel echo server with ssl and the client connect with wss and work, but withno with proxypass.

My laravel echo server is running in 6001 port.
In Firefox its say cant conect to wss://


    "authHost": "",
    "authEndpoint": "/broadcasting/auth",
    "clients": [],
    "database": "redis",
    "databaseConfig": {
            "redis": {
                    "host": "",
                    "port": "10087"
            "sqlite": {
                    "databasePath": "/database/laravel-echo-server.sqlite"
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "https",
    "socketio": {},
    "secureOptions": 67108864,
    "sslCertPath": "/etc/ssl/certs/",
    "sslKeyPath": "/etc/ssl/private/",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "subscribers": {
            "http": false,
            "redis": true
    "apiOriginAllow": {
            "allowCors": true,
            "allowOrigin": "*",
            "allowMethods": "GET, POST",
            "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requeste>


bootstrap.js in laravel

import Echo from 'laravel-echo'

 window.Echo = new Echo({
     broadcaster: '',
     host: `${window.location.hostname}`,
     transports: ['websocket']

apache site conf

<VirtualHost *:443>
DocumentRoot /var/www/app/public
<Directory /var/www/app>
                AllowOverride All
        ErrorLog /error.log
        CustomLog /access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/
SSLCertificateKeyFile /etc/ssl/private/

ProxyRequests off
ProxyVia on
RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/            [NC]
RewriteCond %{QUERY_STRING} transport=websocket    [NC]
RewriteRule /(.*)           ws://localhost:6001/$1 [P,L]

ProxyPass        /
ProxyPassReverse /

Source: Laravel

Leave a Reply