title: "Invalid protocol" when trying to connect to Elasticache Redis in Node.js
body: <p>I'm trying to connect an ElastiCache Redis to an Express server deployed on ECS. I'm using the <a href="https://www.npmjs.com/package/redis" rel="nofollow noreferrer">Official Redis package for Node.js</a></p>
  <p>I get the Primary Endpoint from ElastiCache as <code>blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com:6379</code></p>
  <p>In my server I try to connect like this</p>
  <pre class="lang-js prettyprint-override"><code>const { createClient } = require(&quot;redis&quot;);
  const pubClient = createClient({ url: 'blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com:6379' });
  </code></pre>
  <p>But when I check the ECS logs I see</p>
  <pre class="lang-bash prettyprint-override"><code>/usr/src/app/node_modules/@redis/client/dist/lib/client/index.js:124
  throw new TypeError('Invalid protocol');
  ^
  TypeError: Invalid protocol
  at Function.parseURL (/usr/src/app/node_modules/@redis/client/dist/lib/c...
  </code></pre>
  <p>Haven't used Redis so no idea why this is happening. Any idea how to use the endpoint properly</p>
  <p>even tried with</p>
  <pre class="lang-js prettyprint-override"><code>const pubClient = createClient({ host: 'blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com', port:6379 });
  </code></pre>
  <p>but that also didn't work</p>