title: Socket.io - SSL through Cloudflare
body: <p>I've read through nearly every possible tutorial about how to receive SSL through socket.io and I just can't seem to get it to work.</p>
  
  <p>My backend JS is as follows:</p>
  
  <pre><code>var express = require('express');
  
  var options = {
      key: fs.readFileSync('/key.key'),
      cert: fs.readFileSync('/crt.crt'),
      requestCert: true
  };
  var app = express();
  var server = require('https').createServer(options, app);
  var io = require('socket.io').listen(server);
  server.listen(2096, "IP Address");
  </code></pre>
  
  <p>The frontend JS:</p>
  
  <pre><code>SOCKET = io('https://name.com:443', {secure: true});
  </code></pre>
  
  <p>I'm using full SSL, with cloudflare signed certificates install on my server.</p>
  
  <p>I also receive the following error when connecting:</p>
  
  <pre><code>POST https://name.com/socket.io/?EIO=3&amp;transport=polling&amp;t=LcBk2Vk 404()
  </code></pre>
  
  <p>I'm not sure if my ports are incorrect or I'm missing something entirely.</p>
  
  <p>I'm happy to provide more code snippets.</p>
  
  <p>Thanks in advance</p>