title: how to fix this problem, socket.io and codeigniter 3 on hosting server ssl
body: <p>&quot;my problem&quot;</p>
  <p>Request URL: http://localhost:8080/socket.io/?EIO=4&amp;transport=polling&amp;t=O5NT1ct
  Referrer Policy: strict-origin-when-cross-origin</p>
  <p>&quot;my code server.js (server-side socket)&quot;</p>
  <pre><code>const express = require('express');
  const app = express();
  const fs = require('fs');
  const https = require('https');
  const http = require('http');
  
  var ssl_options = {
      key:fs.readFileSync('mykey.key'),
      cert:fs.readFileSync('mykey.crt'),
  };
  
  const server = https.createServer(ssl_options, app);
  const io = require('socket.io')(server,{
      cors:{
          origin:'*'
      }
  });
  
  io.on('connection',(socket) =&gt; {
      console.log('a user connected!');
      socket.on('event',(data) =&gt;{
          io.emit('event', data);
          console.log(data);
      });
  });
  
  app.get('/',(req, res) =&gt; {
      res.redirect('/home');
  });
  server.listen(8080);
  </code></pre>
  <p>&quot;my code script.js (client-side socket)&quot;</p>
  <pre><code>var socket = io(&quot;https://localhost:8080&quot;);
  
    socket.on('event',function(data){
     console.log(data);
   });
  </code></pre>