title: Socket.io how to implement a wss connection?
body: <p>I'm making an authentication service with sockets on node.js with socket.io. </p>
  
  <p>My question is: Which is the way to implement or create a wss connection on server and client side?</p>
  
  <p>My code:</p>
  
  <pre><code>// Server
  var express = require("express");
  var socket = require("socket.io"); 
  
  var app = express();
  
  var port = 5310;
  var server = app.listen(port, function () {
      console.log("Listening to requests on port", port);
  });
  
  var io = socket(server);
  
  io.on("connection", function (socket) {
      // Code
  });
  </code></pre>
  
  <pre><code>// Client
  var io = require("socket.io-client");
  var socket = io.connect("http://localhost:5310");
  
  // Code
  </code></pre>