Comments (16)
It also causes the same issue when using http://.
After looking into it, it seems like the http module doesn't like protocols in its options. I temporarily fixed it by removing "https://" and "http://" in options.host under the httpServer function in server.js.
from laravel-echo-server.
No, the protocol option is still needed, but you don't need the protocol in the host option anymore. This is a part of my json config.
{
"host": "example.local",
"port": "6001",
"protocol": "https"
}
from laravel-echo-server.
Is that immediately after startup? Or did you try and perform an action that caused that to occur?
from laravel-echo-server.
Your ssl files also don't match your host.
from laravel-echo-server.
It happens just after startup.
Just try to add https prefix and you will have same problem.
Ssl files does match my host. I wanted to change my host url, but forget to change ssl files names.
from laravel-echo-server.
I'm experiencing the same problem as well. My host matches my crt and key. Using "host": "https://dev.horizonservers.net"
Was working fine prior to updating to 1.0
from laravel-echo-server.
I'm having the same issue.
Initially I thought it was because I was running node 5 (see other thread). But I upgraded to Node 6.5.0 and I'm still getting this on homestead. Here's a print out of my shell:
22:31:02 ✔ vagrant@homestead $ npm -v
3.10.3
[~/Code/new.wn.dev]
22:31:04 ✔ vagrant@homestead $ node -v
v6.5.0
[~/Code/new.wn.dev]
22:31:07 ✔ vagrant@homestead $ npm outdated
[~/Code/new.wn.dev]
22:31:13 ✔ vagrant@homestead $ npm ls laravel-echo-server
/home/vagrant/Code/new.wn.dev
└── [email protected]
[~/Code/new.wn.dev]
22:31:28 ✔ vagrant@homestead $ cat laravel-echo-server.json
{
"appKey": "drmgqfube6b4t<snip>n86gtjqpqjc6u1j7d",
"authEndpoint": "/broadcasting/auth",
"authHost": "http://new.wn.dev",
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": false,
"host": "http://new.wn.dev",
"port": "6001",
"protocol": "http",
"referrers": [],
"sslCertPath": "",
"sslKeyPath": "",
"verifyAuthPath": true,
"verifyAuthServer": false
}[~/Code/new.wn.dev]
22:31:54 ✔ vagrant@homestead $ laravel-echo-server start
L A R A V E L E C H O S E R V E R
Starting server...
✔ Running at http://new.wn.dev on port 6001
✔ Channels are ready.
✔ Listening for redis events...
✔ Listening for http events...
Server ready!
events.js:160
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND http://new.wn.dev
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
Looks like its including the http
or https
is causing this issue:
http://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound
from laravel-echo-server.
I'm using MAMP to manage my hosts, so a non-port-80-request is not handled by MAMP. That means, the dns record doesn't exist. But Node is checking for the existence and throws an error.
The Server.serverProtocol() method is setting the secure flag by checking the host option. Without https:// in the host option, it will always start a http server.
I changed the condition to (this.options.protocol == 'https') to determine if a http or a https server should be used. The https:// prefix is not needed in the host option anymore.
That works for me.
from laravel-echo-server.
Just confirming you mean you changed this line https://github.com/tlaverdure/laravel-echo-server/blob/master/src/server.ts#L49
To
if (this.options.protocol == 'https') {
Then you dropped using any protocol in the json file for the host
key so it looks like this?
{
"appKey": "",
"authEndpoint": "/broadcasting/auth",
"authHost": "http://example.com",
\\<snip>
"devMode": false,
"host": "example.com",
"port": "6001",
"protocol": "http"
}
Thanks!
from laravel-echo-server.
Although I wrote it wrong above, (now fixed) that's actually what I meant in the first place! 😆
Thank you!
from laravel-echo-server.
@jonnywilliamson can you add PR?
from laravel-echo-server.
@tlaverdure this answer fixed my issue. Can you apply these changes?
from laravel-echo-server.
from laravel-echo-server.
Merge. @pderiy let me know if that closes this.
from laravel-echo-server.
It works great. Thank you guys.
@tlaverdure , @jonnywilliamson
from laravel-echo-server.
you havenot host for '127.0.0.1 localhost'
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.