tlaverdure / laravel-echo-server

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

Not working on DOKKU #401

Closed paschaldev closed 5 years ago

paschaldev commented 5 years ago

I can't get this to work with Dokku / Docker... I've tried on localhost and everything works fine but when I push to production to a dokku container, it just doesn't work. The server starts fine and ready but the client never connects.

laravel-echo-server.json

{
        "authHost": "http://my-ip",
        "authEndpoint": "/api/broadcasting/auth",
        "clients": [],
        "database": "sqlite",
        "databaseConfig": {
                "redis": {
                        "port": "6379",
                        "host": "172.17.0.2",
                        "password": "pass"
                },
                "sqlite": {
                        "databasePath": "/database/laravel-echo-server.sqlite"
                }
        },
        "devMode": true,
        "host": "0.0.0.0",
        "port": "6001",
        "protocol": "http",
        "socketio": {},
        "sslCertPath": "",
        "sslKeyPath": "",
        "sslCertChainPath": "",
        "sslPassphrase": "",
        "subscribers": {
                "http": true,
                "redis": true
        },
        "apiOriginAllow": {
                "allowCors": true,
                "allowOrigin": "*",
                "allowMethods": "GET, POST",
                "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
        }
}

I see this output from the log

L A R A V E L  E C H O  S E R V E R
2019-04-19T01:48:40.183990302Z app[echo-server.1]: 
2019-04-19T01:48:40.185914126Z app[echo-server.1]: version 1.5.0
2019-04-19T01:48:40.185926285Z app[echo-server.1]: 
2019-04-19T01:48:40.186178078Z app[echo-server.1]: ⚠ Starting server in DEV mode...
2019-04-19T01:48:40.186455243Z app[echo-server.1]: 
2019-04-19T01:48:40.253974198Z app[echo-server.1]: ✔  Running at 0.0.0.0 on port 6001
2019-04-19T01:48:40.254617372Z app[echo-server.1]: ✔  Channels are ready.
2019-04-19T01:48:40.258703950Z app[echo-server.1]: ✔  Listening for http events...
2019-04-19T01:48:40.360605271Z app[echo-server.1]: ✔  Listening for redis events...
2019-04-19T01:48:40.360887808Z app[echo-server.1]: 
2019-04-19T01:48:40.360898720Z app[echo-server.1]: Server ready!
paschaldev commented 5 years ago

Apparently dokku doesn't allow external port asides from web.