title: script source not found, in node.js when trying https connection
body: <p>im trying to reference socket.io in my login.html but it gives following error:</p>
  <pre><code>GET https://localhost:3000/socket.io.js net::ERR_ABORTED 404 (Not Found)
  </code></pre>
  <p>i think its because this code line in my login.html :</p>
  <pre><code>&lt;script src='/client-dist/socket.io.js'&gt;&lt;/script&gt;
  </code></pre>
  <p>i was trying other reference the script in other ways, but those doesnt work. it worked when my server.js was a <code>http</code> connection, but now i need a <code>https</code> connection.
  its also dont possible to reference oder <code>javascript</code> refrences.</p>
  <p>login.html:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;title&gt;Login&lt;/title&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;/style.css&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
     
  &lt;section&gt;
  
    &lt;h1&gt;Login&lt;/h1&gt;
  
  &lt;p&gt;
    username:&lt;input id=&quot;username&quot;&gt;
    &lt;br&gt;
    password:&lt;input id=&quot;password&quot;&gt;
    &lt;br&gt;
    
  &lt;/p&gt;
  
  &lt;p&gt;
    
    &lt;button onclick=&quot;window.location.href='/register'&quot;&gt;Create Account&lt;/button&gt;
  &lt;/p&gt;
  
  &lt;button id=&quot;submitButtonLogin&quot; onclick=&quot;onClick()&quot;&gt;submit&lt;/button&gt;
    
  
      &lt;/section&gt;
  
      &lt;script src='/client-dist/socket.io.js'&gt;&lt;/script&gt;
      
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>server.js:</p>
  <pre><code>const express= require('express')
  const app= express();
  //const path= require('path')
  const https= require('https')
  const io=require('socket.io')(https,{maxHttpsBufferSize:1e8})
  const fs=require('fs')
  
  
  
  
  const sslServer =https.createServer({
      key: fs.readFileSync('cert/key.pem'),
      cert: fs.readFileSync('cert/cert.pem')
  },app)
  
  
  const PORT=process.env.PORT || 3000
  
  
  
  sslServer.listen(PORT, ()=&gt;{
      console.log(`listening to port ${PORT}`)
  });sslServer.setTimeout(0)
  
  
  app.get('/test', (req,res)=&gt;{
      res.sendStatus(200);
  })
  
  app.use(express.static(__dirname + '/public'))
  
  app.use(require('./routes/posts'));
  
  app.use(require('./routes/users'));
  
  app.get('/',(req,res)=&gt;{
      res.sendFile(__dirname + '/login_register/login.html')
  })
  
  
  app.get('/register',(req,res)=&gt;{
      res.sendFile(__dirname + '/login_register/register.html')
  })
  
  app.get('/chatroom',(req,res)=&gt;{
      res.sendFile(__dirname + '/index.html')
  })
  </code></pre>
  <p>my hierarchy:</p>
  <pre><code>chatapplication
  -cert
      cert.pem
      csr.pem
      key.pem
  -login_register
      login.html
      register.html
  -model
      user.js
  -node_modules
      (included when setup) 
  -public
      client.js
      style.css
  -routes
      users.js
  database.js
  index.html
  package-lock.json
  package.json
  secret.json
  server.js
  </code></pre>