Search code examples
socket.ionodesmeanjs

How can I workout sockets in boilerplate structure with unauthenticated?


I am working with sockets (meanjs - boilerplate ) . I'm unable to workout chat without authentication. What I want is user should able to chat without signing in. And I have doubt, Can I have sockets in different modules so they can't talk to each other?

Thank you


Solution

  • I think you will need to adapt the code in /config/lib/socket.io.js to achieve that. You will have to change the code block which starts in line 78 of that file, which handles the session and passport authentication during socket.io handshake so that it won't check for authentication, allowing the socket connection to be established without it.

    For your second question, this comment gives some hints on how to expand from the default socket implementation for more complex situations.