I have created a node server and used socket.io in my application. Since my application is running in a https, i have included the ssl certificate and key when creating the server. But when i start the node server and check the client side application it gives the error net::ERR_CONNECTION_REFUSED in the console. It will be great if someone can help me out with this. Thanks.
Below is my server side and client side codes,
Server side server.js file
var https = require('https');
var express = require('express');
var app = express();
var fs = require('fs');
var options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
var server = https.createServer(options, app);
var io = require('socket.io')(server);
server.listen(8000);
client side js files inclution
<script src="https://myhost.com:8000/socket.io/socket.io.js"> </script>
<script>
var socket = io('https://myhost.com:8000');
</script>