添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i try run laravel-echo-server start but i have error like this

L A R A V E L E C H O S E R V E R

version 1.5.0

⚠ Starting server in DEV mode...

✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)

solution for me?
#sorryForMyEnglish

eduardoalvara2, czanbaka, InnaMantulenko, ivalrivall, serrulla, w3lifer, kapalkat, dev-dwr, stu640978, AliTarek97, and 9 more reacted with thumbs up emoji w3lifer, webdev0415, and asher-lab reacted with hooray emoji TheUniqueMathemagician and brunolazo reacted with confused emoji All reactions tyler36, CaptainCannabis, manjuXD, jelleroorda, mhemrg, marcelomds, benhabib-mhd, and rishabhrao reacted with thumbs up emoji mhemrg, marcelomds, and benhabib-mhd reacted with hooray emoji All reactions

Seems like Redis is not installed or the Redis server is not running.
Install a copy from https://redis.io/
And then run the service with "redis-server".
After that you can smoothly run "laravel-echo-server start"

anuragshah17, billVladimir, joanDeveloper, srhtylmz19, RadhaKishan143, theavuthnhel, jtpdev, Islam44, maihao1997, pavanyogi, and 6 more reacted with thumbs up emoji billVladimir, Aelameen, jtpdev, and Jefferson1919 reacted with hooray emoji billVladimir, mxgrim, SamirMokiem, JuniorNunes7, jtpdev, Jefferson1919, beeena, pjoshicodal, pharidali, and aprvraj reacted with heart emoji All reactions

you just have to download the Redis server from the website below and execute redis-server.exe to start redis server.

https://riptutorial.com/redis/example/29962/installing-and-running-redis-server-on-windows

As @j0hnys said, you need to add the following config to your laravel-echo-server.json file:

"subscribers": {
	"http": true,
	"redis": false
          

This document is for those who use laravel echo server & nginx & socket.io & redis-server with separated server between client project and redis-server.

1) Edit /etc/redis/redis.conf

bind 127.0.0.1
supervised no
bind 0.0.0.0
supervised systemd

2) Update /etc/systemd/system/redis.service under [Service]

Type=notify
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf  --supervised systemd

3) Nginx /etc/nginx/sites-enabled/reverse-proxy.conf

server {
  listen        443 ssl;
  listen        [::]:443 ssl;
  server_name   mysitecom;
  error_log     /var/log/nginx/proxy-error.log error;
  # Start the SSL configurations
  ssl                         on;
  ssl_certificate             /etc/nginx/certs/mysitecom.pem;
  ssl_certificate_key         /etc/nginx/certs/mysitecom.key;
  ssl_session_timeout         3m;
  ssl_session_cache           shared:SSL:50m;
  ssl_protocols               TLSv1.1 TLSv1.2;
  # Diffie Hellmann performance improvements
  ssl_ecdh_curve              secp384r1;
  location /socket.io {
    proxy_pass                          http://mysitecom:2096;
    proxy_http_version 1.1;
    proxy_set_header Upgrade            $http_upgrade;
    proxy_set_header Connection         "upgrade";
    proxy_set_header Host               $host;
    proxy_set_header X-Real-IP          $remote_addr;
    proxy_buffers 16 4k;
    proxy_buffer_size 2k;
    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto  https;
    proxy_set_header X-VerifiedViaNginx yes;
    proxy_read_timeout                  2h;
    proxy_connect_timeout               2h;
    proxy_redirect                      off;

4) laravel-echo-server.json

"authHost": "https://mysitecom", "authEndpoint": "/broadcasting/auth", "clients": [ "appId": "e45c056ec8ca8bd7", "key": "88d316b5cccafbc5e905aa9ee13e63f7" "database": "redis", "databaseConfig": { "redis": { "host": "0.0.0.0", "port": "6379" "sqlite": { "databasePath": "/database/laravel-echo-server.sqlite" "devMode": true, "host": null, "port": "2096", "protocol": "https", "socketio": {}, "secureOptions": 67108864, "sslCertPath": "/etc/nginx/certs/mysitecom.pem", "sslKeyPath": "/etc/nginx/certs/mysitecom.key", "sslCertChainPath": "", "sslPassphrase": "", "subscribers": { "http": true, "redis": true "apiOriginAllow": { "allowCors": true, "allowOrigin": "*", "allowMethods": "GET, POST", "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"

Note: for someone who connects DNS with cloudflare please change default socket.io port 6001 to the following here.

devkea, namsir, swanback, MarcoSantana, robenson-dev, santooooooo, chinmoym2004, and speedy236 reacted with thumbs up emoji kanfur and MarcoSantana reacted with heart emoji MarcoSantana reacted with rocket emoji All reactions

this code runs on my local mechine with redis docker image. But when I dockerize my nodejs code and try to run the code it shows this error
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)

Redis container is running fine in Port 6900