Comments (3)
@jonnywilliamson Does this help?
from laravel-echo-server.
No. This is still plaguing me and I cannot find a reason.
I can get receive ALL broadcasts sent to the page, as long as I open the page and wait exactly 2 mins for something to timeout. It's crazy, I don't even know where to debug.
I ran a test. I open my webpage and have 3 listeners set up.
1 for public broadcast (no auth needed)
1 for private broadcast (auth needed)
1 for presence channel (auth needed).
I can see that as soon as I open my page, an ajax/socket.io request is instantly sent to my authHost (http://new.wn.dev
) with all the correct data. However it never gets to the laravel app....it seems to timeout exactly 2 mins later.
In another window I fire off 3 events, 1 public, 1 private and 1 presence channel. The public one gets received (console log) instantly. The other 2 never arrive.
As soon as 2 mins is up and I reload page 2 to send the 3 events, all 3 get logged immediately!
Any thoughts gladly received!
from laravel-echo-server.
I've never spent so much time on a bug before - coming up on 3 weeks now. But I finally have an answer to this.
And of course it's incredibly simple and complex all at the same time.
After hours and hours of testing code and debugging variables, I finally noticed that one of my sites was resolving to 127.0.53.53 and not 127.0.0.1 as would be the norm on vagrant.
This stood out like a sore thumb and I went googling.
I finally came across a few threads and it all came together.
My websites all use .dev
as the domain TLD and I've been using that for quite a while without ever having an issue before. However, it appears google is in the process of being the owner of the .dev
domain and in doing so a name collision occurs when you try and use it for your own projects in certain circumstances and software versions.
Here's more info : https://www.icann.org/resources/pages/name-collision-2013-12-06-en#127.0.53.53
So what was happening was that node was trying to resolve my domain of new.wn.dev
and was being directed to 127.0.53.53 instead of 127.0.0.1
For whatever reason with software versions installed and Ubuntu versions etc, this then caused a timeout for exactly 120 secs before everything started to work. (May also be related to this http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout)
The Fix
So simple. Stop using ANY TLD that is in the process of being setup/bought (eg .dev
) and use one that has been designed specifically not to be used in the future. eg .test
More suggestions here: https://iyware.com/dont-use-dev-for-development/
As soon as I changed my developement domains to .test
everything just clicked into place.
Public, private and presence channels all work now instantly without any timeouts etc.
And finally I can sleep without having this at the back of my mind!
For the record, here's what my laravel-echo-server.json
file looks like.
{
"appKey": "k7mo168sssssssssssssssssssssss6qtfh",
"authEndpoint": "/broadcasting/auth",
"authHost": "http://new.wn.test",
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": false,
"host": "localhost",
"port": "6001",
"protocol": "http",
"referrers": [],
"sslCertPath": "",
"sslKeyPath": "",
"verifyAuthPath": true,
"verifyAuthServer": false
}
I hope this helps someone.
from laravel-echo-server.
Related Issues (20)
- Is the package compromised? HOT 6
- Laravel-echo-server events listeners custom callbacks
- Redis6 ACL Support HOT 1
- 运行一会,就会中断,提示截图显示的错误 HOT 2
- Cannot find module '../dist/cli' - supervisord
- Redis 6 ACL config HOT 1
- Connection refused on docker
- Laravel Echo Server work and client side error only at server HOT 2
- Is there ways to emit data from client (socket.io-client) to laravel-echo-server? HOT 2
- Laravel Echo PresenceChannel vs listen events doesn't work HOT 2
- 使用Laravel 5.8 广播系统,本地研发没有事情,上线后握手阶段,第一次OK,第二次报502,第三次报session id unknown,现在不知道是那个地方出问题了?求帮助 HOT 1
- Is `tlaverdure/laravel-echo-server` abandoned? HOT 6
- Is the cors configuration even working? HOT 1
- echo server socket.io.js error
- support redis cluster
- Redis TTL key is store forever
- CSRF token mismatch after session timeout
- npx laravel-echo-server start HOT 1
- Unable to join channel. Member data for presence channel missing HOT 1
- Is this project compatible with Socket.io v4? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-echo-server.