[英]Laravel echo-server socket.io connection refused on docker
I'm struggling with a setup for Laravel echo server on Docker (laradock).我正在努力在 Docker(laradock)上设置 Laravel 回显服务器。 I followed up this tutorial .
我跟进了本教程。 I setup a new laravel project under docker, and setup host to be testing.localhost.
我在 docker 下设置了一个新的 laravel 项目,并将主机设置为 testing.localhost。 Connection with Redis works fine, echo server works fine and even listen for messages:
与 Redis 的连接工作正常,回显服务器工作正常,甚至监听消息:
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:我的 laravel-echo-server.json 包含这个:
{
"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:在客户端应用程序(Angular 应用程序)上,我尝试了几种组合:
// 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?有谁知道如何解决这个问题?
Add to host laravel echo 0.0.0.0添加到主机 laravel echo 0.0.0.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.