I have set up and can successfully use my socket for a chat application on the iPhone using port :3000. However when I try to use port :443, I cannot connect.
My index.js file begins:
var app = require('express')();
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('...path/example.com.key'),
cert: fs.readFileSync('...path/example.com.crt'),
ca: fs.readFileSync('...path/intermediate.crt')
};
var server = https.createServer(options, app);
var io = require('socket.io')(server);
server.listen(443, function(){
console.log('Listening on *:443');
});
And on the client side, my attempted connection is:
var socket: SocketIOClient = SocketIOClient(socketURL: URL(string: "https://www.example.com:443")!)
The socket connection is hanging and empty JSON returned. Wondering if I need a configuration file or something else to make this work. If I change 443 to 3000 above, everything works fine but I need to use SSL.
Ports below a certain number generally require the application run as a superuser. Besides that, make sure you understand Apple's strict requirements for TLS connections.