Reputation: 563
I'm struggling with a setup for Laravel echo server on Docker (laradock). I followed up this tutorial. I setup a new laravel project under docker, and setup host to be testing.localhost. Connection with Redis works fine, echo server works fine and even listen for messages:
L A R A V E L E C H O S E R V E R
version 1.6.2
⚠ Starting server in DEV mode...
✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
✔ Listening for redis events...
Server ready!
Channel: user-channel
Event: UserEvent
My laravel-echo-server.json contains this:
{
"authHost": "localhost",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {
"port": "6379",
"host": "redis"
}
},
"devMode": true,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"sslCertPath": "",
"sslKeyPath": ""
}
On client app (Angular application), I tried a several combination:
// const config: SocketIoConfig = { url: '10.0.75.1:6001', options: {} }; - docker IP address
// const config: SocketIoConfig = { url: '192.168.1.7:6001', options: {} }; - my IP address
// const config: SocketIoConfig = { url: 'localhost:6001', options: {} };
// const config: SocketIoConfig = { url: '127.0.0.1:6001', options: {} };
But I always get a message in console
/socket.io/?EIO=4&transport=polling&t=Nf9A_rY net::ERR_CONNECTION_REFUSED
Does anyone know how to solve this problem?
Upvotes: 1
Views: 1234