-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Socket.IO
Socket.IO is used as backend to support clients communicating between other users. However, to use this service, you need to be authenticated to the socket microservice. Support for sockets was introduced in this commit.
Notes
However, due we require authentication to our microservice, we are forced to not use auto-connection to the socket server. (Specified here). Because of that we will be referencing this. So, we should do following

Authentication
Authentication with the Socket Microservice will happen by using JWT token provided by authentication microservice. You should set the token as query paramter before opening the socket.
Example
this.$socket.io.opts.query = { Authorization: JWT.encoded }; // First set the token.
this.$socket.open(); // Then open the socket and use it anywhere else.Logic reading this token on the Microservice is defined here.
Socket Microservice
I will be settings up the socket microservice into our production environment sooner or later. However, now you can get it locally with following instructions:
git clone git@gitlab.com:GameTactic/Socket.git
cd Socket
yarn install
yarn debugCommand yarn debug will run the server with debugging enabled. This is handy, so you can see what is happening on the server while you try get this working.
Other
Please see #89 how the authentication should happen. It might be little raw or good, who knows, but that is totally something you want to take look while implementing the Socket.IO support as Socket.IO depends on the authentication logic. You should first implement #15 then continue with Socket.IO.
