title: Laravel-echo-server, Redis and Ubuntu 18.04.4 [ioredis] Error: connect ETIMEDOUT
body: <p>I hope someone can help me in solving this problem:</p>
  <p>I have my laravel project (7.x) broadcasting without problems on local environment (Laragon 4.0 with redis). I wanted to move it live to make some more accurate test on my VPS with Ubuntu 18.04.4, apache2, virtualmin cp.</p>
  <p>I did install redis server (latest version) and is up and running (PING -&gt; PONG, create key-&gt;value, read key-&gt;value... restart service and key-&gt;value still there... all tests working great). When I fire my event and broadcast something I see it in queue:work regularly, but everytime I launch LARAVEL ECHO SERVER and the client connects very fast and after few seconds I start to receive this error in console:</p>
  <pre><code>[ioredis] Unhandled error event: Error: connect ETIMEDOUT
  at Socket.&lt;anonymous&gt; (/usr/local/lib/node_modules/laravel-echo-server/node_modules/ioredis/built/redis/index.js:285:37)
  at Object.onceWrapper (events.js:313:30)
  at emitNone (events.js:106:13)
  at Socket.emit (events.js:208:7)
  at Socket._onTimeout (net.js:420:8)
  at ontimeout (timers.js:482:11)
  at tryOnTimeout (timers.js:317:5)
  at Timer.listOnTimeout (timers.js:277:5)
  </code></pre>
  <p>I checked every single post here on stackoverflow, laracasts and everywhere this error is mentioned but I cannot find a solution.
  The interested part of my .env file is here:</p>
  <pre><code>APP_NAME=Testapp
  APP_ENV=local
  APP_KEY=[omitted]
  APP_DEBUG=true
  APP_URL=[omitted]
  LOG_CHANNEL=stack
  DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=17306
  DB_DATABASE=[omitted]
  DB_USERNAME=[omitted]
  DB_PASSWORD=[omitted]
  BROADCAST_DRIVER=redis
  CACHE_DRIVER=none
  QUEUE_CONNECTION=redis
  SESSION_DRIVER=database
  SESSION_LIFETIME=1200
  REDIS_HOST=127.0.0.1
  REDIS_PASSWORD=null
  REDIS_PORT=6379
  </code></pre>
  <p>Here is Broadcasting.php</p>
  <pre><code>    'default' =&gt; env('BROADCAST_DRIVER', 'null'),
  
  /*
  |--------------------------------------------------------------------------
  | Broadcast Connections
  |--------------------------------------------------------------------------
  |
  | Here you may define all of the broadcast connections that will be used
  | to broadcast events to other systems or over websockets. Samples of
  | each available type of connection are provided inside this array.
  |
  */
  
  'connections' =&gt; [
  
      'pusher' =&gt; [
          'driver' =&gt; 'pusher',
          'key' =&gt; env('PUSHER_APP_KEY'),
          'secret' =&gt; env('PUSHER_APP_SECRET'),
          'app_id' =&gt; env('PUSHER_APP_ID'),
          'options' =&gt; [
              'cluster' =&gt; env('PUSHER_APP_CLUSTER'),
              'useTLS' =&gt; true,
          ],
      ],
  
      'redis' =&gt; [
          'driver' =&gt; 'redis',
          'connection' =&gt; 'default',
      ],
  </code></pre>
  <p>My Database.php</p>
  <pre><code>    'redis' =&gt; [
  
      'client' =&gt; env('REDIS_CLIENT', 'phpredis'),
  
      'options' =&gt; [
          'cluster' =&gt; env('REDIS_CLUSTER', 'redis'),
          'prefix' =&gt; env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
      ],
  
      'default' =&gt; [
          'url' =&gt; env('REDIS_URL'),
          'host' =&gt; env('REDIS_HOST', '127.0.0.1'),
          'password' =&gt; env('REDIS_PASSWORD', null),
          'port' =&gt; env('REDIS_PORT', '6379'),
          'database' =&gt; env('REDIS_DB', '0'),
      ],
  
      'cache' =&gt; [
          'url' =&gt; env('REDIS_URL'),
          'host' =&gt; env('REDIS_HOST', '127.0.0.1'),
          'password' =&gt; env('REDIS_PASSWORD', null),
          'port' =&gt; env('REDIS_PORT', '6379'),
          'database' =&gt; env('REDIS_CACHE_DB', '1'),
          'timeout' =&gt; 10000,
      ],
  </code></pre>
  <p>My laravel-echo-server.json</p>
  <pre><code>{
  &quot;authHost&quot;: &quot;127.0.0.1&quot;,
  &quot;authEndpoint&quot;: &quot;/broadcasting/auth&quot;,
  &quot;clients&quot;: [],
  &quot;database&quot;: &quot;redis&quot;,
  &quot;databaseConfig&quot;: {
      &quot;redis&quot;: {},
      &quot;sqlite&quot;: {
          &quot;databasePath&quot;: &quot;/database/laravel-echo-server.sqlite&quot;
      }
  },
  &quot;devMode&quot;: true,
  &quot;host&quot;: null,
  &quot;port&quot;: &quot;6001&quot;,
  &quot;protocol&quot;: &quot;https&quot;,
  &quot;socketio&quot;: {},
  &quot;secureOptions&quot;: 67108864,
  &quot;sslCertPath&quot;: &quot;/home/[myuser]/ssl.cert&quot;,
  &quot;sslKeyPath&quot;: &quot;/home/[myuser]/ssl.key&quot;,
  &quot;sslCertChainPath&quot;: &quot;&quot;,
  &quot;sslPassphrase&quot;: &quot;&quot;,
  &quot;subscribers&quot;: {
      &quot;http&quot;: true,
      &quot;redis&quot;: true
  },
  &quot;apiOriginAllow&quot;: {
      &quot;allowCors&quot;: false,
      &quot;allowOrigin&quot;: &quot;&quot;,
      &quot;allowMethods&quot;: &quot;&quot;,
      &quot;allowHeaders&quot;: &quot;&quot;
  }
  </code></pre>
  <p>}</p>
  <p>The ports on firewall should be open and I find the services listening on their ports.</p>
  <p>I really don't know what else to do, please if someone can help me because I'm getting old and I want to solve it before I retire :)</p>
  <p>Thanks,</p>
  <p>Simone</p>
  <p><strong>UPDATE</strong></p>
  <p>I did configure Redis on a unixsocket and avoid network problems, now working good.</p>