tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 511 forks source link

[Laravel-echo-server] Listening events on remote server #584

Open Ibrahim-Saleh-B opened 2 years ago

Ibrahim-Saleh-B commented 2 years ago

I'm working with redis, laravel-echo-server, and laravel. I'm trying to listen on private channels from another computer, i have my "laravel-echo-server.json" in one computer. When i'm trying to listen on my private channels from my other computer i automatically have this error :

Client can not be authenticated, got HTTP status 403

Even if i have just a 'return true;' on both of my "channels.php" files.

Here's my laravel-echo-server.json file :

{
    "authHost": "http://localhost:8000",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "",
            "key": ""
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {},
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "secureOptions": 67108864,
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "subscribers": {
        "http": true,
        "redis": true
    },
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "http://localhost:80",
        "allowMethods": "GET, POST",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

PS : I have no problem with public channels (only with private channels).

rennokki commented 2 years ago

This package seems to be abandoned. I have initially forked the app, but I found out how inefficient is Socket.IO, and managed to create an open-source Pusher alternative (that doesn't require Pusher credentials) that can be deployed anywhere for free. This does require the driver to be switched from Socket.IO to Pusher. Not sure if it helps, but I wanted to spread the word about it. 😁 Read more about it here.