Securing Socket.io

后端 未结 3 1111
臣服心动
臣服心动 2020-12-15 21:03

I am using a Node.js based https server that authenticates using HTTP Basic (which is fine as the data are sent over the SSL encrypted connection).

Now I want to pro

3条回答
  •  悲&欢浪女
    2020-12-15 21:57

    1. Setting the socket to be secured is done by:

      • setting the secure flag - as you wrote ({secure: true})
      • OR by using https protocol when creating the server (instead of http) - which will set the secure flag to be true automatically
    2. Good lib that simplify the authentication process is: https://github.com/auth0/socketio-jwt

提交回复
热议问题