title: Can't set up websocket on my ec2 instance
body: <p>I followed this <a href="https://stackoverflow.com/questions/31338927/how-to-create-securetls-ssl-websocket-server/36212597">post</a> and I created this below:</p>
  <pre><code>const express = require('express');
  const https = require('https');
  const WebSocket = require('ws');
  const fs = require('fs');
  
      var privateKey  = fs.readFileSync('key.pem', 'utf8');
      var certificate = fs.readFileSync('cert.pem', 'utf8');
   
      var credentials = {key: privateKey, cert: certificate};
     
      var app = express();
      
      var httpsServer = https.createServer(credentials, app);
      httpsServer.listen(3000);
  
      var WebSocketServer = require('ws').Server;
      var wss = new WebSocketServer({
          server: httpsServer
        });
  
      wss.on('connection', function connection(ws) {
        ws.on('message', function incoming(message) {
          console.log('received: %s', message);
        });
  
        ws.send('something');
      });
  </code></pre>
  <p>Running this seems fine on the surface, but then when I try to connect to said websocket on the same ec2 instance with  <code>ws = new WebSocket('wss://(the private or public Ip, or the domain for my website, I tried all of them):3000';</code> and I get the error: <code>WebSocket connection to 'wss://stuff' failed:</code></p>
  <p>Are there additional logs I could look at that might reveal the problem, maybe an additional step I need because of how I'm trying to set this up on an ec2, or is there just something plain wrong with what I did here? Thanks!</p>