1
votes

I have an issue related to socket.io on its nodejs server. Issue is something related to socket.io is not working on IOS mobile browser in IOS8+. I have searched for it and went through some solutions but nothing worked. Here are the issue links:
https://github.com/Automattic/socket.io/issues/976
http://www.codedisqus.com/7yzSqUgqge/socketio-working-on-desktop-safari-chrome-but-not-mobile.html

Here is the code


    io.sockets.on('connection', function(socket) {
    process.emit('client-connection', socket.id);
      socket.on('authenticate', function(message) {
        console.log('Authenticating client with key "' + message.authToken + '"');
        authenticateClient(socket, message);
      });
    socket.on('message', function(message) {
    if (io.sockets.sockets[socket.id] && message.hasOwnProperty('type')) {
       if (message.hasOwnProperty('channel')) {
          if (settings.clientsCanWriteToChannels || ChannelIsClientWritable(message.channel)) {
              process.emit('client-message', socket.id, message);
          }
        }
       return;
      }
    });
    socket.on('disconnect', function () {
      console.log("in disconnect");
      process.emit('client-disconnect', socket.id);
      cleanupSocket(socket);
    });
    })

Please let me know.

The basic issue is that when I try to open a session on browser it works fine and if I try to do the same on iPhone device browser it fails to work.

1

1 Answers

0
votes

As per requirement the issue was IOS socket was not opening over SSL in mobile browsers. I have reinstalled the SSL certificate with complete code packet and it worked for me.

There might be some issue with SSL code packet due to which configuration was not complete.