0

This question describes the same problem than this one.

However the provided solution doesn't work for me.

The log of my angular app looks like (the last digit increments every second or so):

GET https://54.86.104.202/socket.io/?EIO=3&transport=polling&t=1421524885321-3 404 (Not Found)
XHR finished loading: GET "https://54.86.104.202/socket.io/?EIO=3&transport=polling&t=1421524885321-3".

I've set the server as follows :

var fs = require('fs');
var https = require('https');
var sslOptions = {
      key: fs.readFileSync('/var/ssl/server.key'),
      cert: fs.readFileSync('/var/ssl/server.crt'),
      ca: fs.readFileSync('/var/ssl/ca.crt'),
      agent: false,
      requestCert: true,
      rejectUnauthorized: false
    };
var server = https.createServer(sslOptions);

var io = require('socket.io').listen(server);
server.listen(9876);

So to me it appears that everything should be working fine, but it seems that the socket server isn't started. Any idea why?

The same result happens when I use a snippet from one of my old apps :

var io = require('socket.io').listen(https.createServer(sslOptions).listen(9876));

Could it have something to do with the fact that I'm using socket.IO 1.x ?

Community
  • 1
  • 1
xShirase
  • 11,975
  • 4
  • 53
  • 85

0 Answers0