title: How to run NODE.JS (Socket.io) - CENTOS 7 with SSL domain?
body: <p>My socket.io project "xampp" works fine for localhost.</p>
  
  <p>I have a Centos 7 (cPanel) server. I did everything when I threw files into my server. I wrote the command "nodemon server.js" and the server is running. But I am having SSL-related problems with Client.</p>
  
  <p>My site has SSL. I'm using CloudFlare. For this reason, the <em>client</em> cannot communicate with the <em>server</em>.</p>
  
  <p>My project is running when I disable SSL.</p>
  
  <p>How does <strong>Socket.io</strong> work with <strong>SSL</strong>?</p>
  
  <p><strong>CLOUDFLARE</strong>:
  <a href="https://i.stack.imgur.com/OHe1r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OHe1r.png" alt="enter image description here"></a></p>
  
  <p><strong>CHROME CONSOLE LOG:</strong>
  <a href="https://i.stack.imgur.com/bsV8o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bsV8o.png" alt="enter image description here"></a></p>
  
  <p><strong>Client CODE:</strong></p>
  
  <pre><code>var socket = io.connect('https://example.com:1347');
  </code></pre>
  
  <p><strong>Server.js CODE</strong></p>
  
  <pre><code>var server     = require('https').createServer(),
      io         = require('socket.io')(server),
      port       = 1337;
  
  server.listen(port);
  </code></pre>