Socket.io page not found cause it listen on http server and the website js connect to it by https, this is my solution, hope it helpful:
var https = require('https');
var express = require('express');
var app = express();
// app.use ...
// app.set ...
var credentials = {
key: fs.readFileSync('./config/privateKey'),
cert: fs.readFileSync('./config/certificate')
};
var https_server = https.createServer(credentials, app);
var io = SocketIO.listen(https_server, {});
io.set('authorization', function(handshakeData, callback) {
// ...
});
io.sockets.on('connection', function(socket) {
// ...
});