How do I secure Socket.IO?

前端 未结 2 765
旧时难觅i
旧时难觅i 2020-12-10 10:40

I\'ve been working with Socket.IO for a few days and it\'s been both extremely exciting and even more frustrating. The lack of current documentation/tutorials has made learn

相关标签:
2条回答
  • 2020-12-10 11:05

    The excellent passport framework for express uses secure cookies to validate identity. There is even a module to access it from socket.io.

    0 讨论(0)
  • 2020-12-10 11:10

    If you can install a key-value store like Redis on your node server, you can access it remotely from your php server using a Redis client like Predis. All you have to do is updating the remote session store on node server when a new login/logout happens in your php server.

    Check this post for details: Authenticate user for socket.io/nodejs

    0 讨论(0)
提交回复
热议问题