code: function appendUser(socket, params) {
          try {
              var extra = params.extra;
  
              var params = socket.handshake.query;
  
              if (params.extra) {
                  try {
                      if (typeof params.extra === 'string') {
                          params.extra = JSON.parse(params.extra);
                      }
                      extra = params.extra;
                  } catch (e) {
                      extra = params.extra;
                  }
              }
  
              listOfUsers[socket.userid] = {
                  socket: socket,
                  connectedWith: {},
                  extra: extra || {},
                  admininfo: {},
                  socketMessageEvent: params.socketMessageEvent || '',
                  socketCustomEvent: params.socketCustomEvent || ''
              };
          } catch (e) {
              pushLogs(config, 'appendUser', e);
          }
  
          sendToAdmin();
      }
docs: to secure your socket.io usage: (via: docs/tips-tricks.md) io.set('origins', 'https://domain.com');