Search Posts

Category: socket.io

Failed to connect socket using https in nodejs

While developing a chat application using nodejs,angular i am trying to connect with socket with the help of namespace using http , it was perfectly working.While i am running the same application with https, it was not connecting to socket code. server require(‘./libs/socketioCode.js’).sockets(https); var options = { key: fs.readFileSync(‘privkey.pem’), cert: fs.readFileSync(‘cert.pem’) }; var server = http.createServer(app).listen(3000); var server1 = https.createServer(options, app).listen(3443); var io = require(‘socket.io’).listen(server1); socket module.exports.sockets = function(https){ io = socketio.listen(https); I tried this […]