gpt4 book ai didi

laravel - net::ERR_CONNECTION_TIMED_OUT error in laravel echo with redis driver

转载 作者:IT王子 更新时间:2023-10-29 06:11:02 41 4
gpt4 key购买 nike

我正在使用带有 redis 驱动程序的 laravel-echo 来广播通知。它在我的本地系统上完美运行。但是在我的服务器上,我收到了 ERR_CONNECTION_TIMED_OUT 错误。浏览器控制台显示 http://ex.example.com:6001/socket.io/socket.io.js net::ERR_CONNECTION_TIMED_OUT

我对socket和redis一无所知。所以我只是按照 laravel official doc 的说明进行操作和 laravel-echo-server .并仅对 here 进行了一处更改.但是在这个改变的帮助下,我能够让执行剩余的 js 脚本。 socket.io.js 问题仍未解决(也在 github 中)。

这是我遵循的步骤。

  1. 关注Laravel Official Doc
  2. 安装 Redis-Server
  3. 安装 laravel-echo-server
  4. 安装 socket.io-clent在我的项目中

js

import Echo from "laravel-echo"
window.io = require('socket.io-client'); //suggested in github issue
window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001'
});

laravel-echo-server.json

{
"authHost": "http://ex.example.com",
"authEndpoint": "/broadcasting/auth",
"clients": [
{
"appId": "edbf10287972d875",
"key": "96403c9f93e1a2d86185e2d21aa0fae1"
}
],
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": true,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"sslCertPath": "",
"sslKeyPath": ""
}

如果有人知道解决方案,我们将不胜感激。

最佳答案

这听起来很简单,但您是否检查过服务器上的防火墙设置?

编辑:感谢@AkshayVaghasiya 分享正确设置防火墙的说明 [read here] .

关于laravel - net::ERR_CONNECTION_TIMED_OUT error in laravel echo with redis driver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43680473/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com