Config files

In the root messenger-app directory and also in directories messenger-api/src and socket-server/src is a config file. It is divided into three groups: development, staging, and production.

Socket Server

socket-server/src/config.js
{
  development: {
    port: 4000, // node server port 
    socket_secret: 'SOCKET SECRET',
    redis: {
      host: 'localhost',
      port: 6379
    }
  },
  production: {
    port: 4000, // node server port 
    socket_secret: 'SOCKET SECRET',
    redis: {
      host: '<redis-host>',
      port: 6379,
      pass: '<redis-password>' // Optional, if the password for redis exists
    }
  },
  staging: {
    port: 4000, // node server port 
    socket_secret: 'SOCKET SECRET',
    redis: {
      host: '<redis-host>',
      port: 6379,
      pass: '<redis-password>' // Optional, if the password for redis exists
    }
  }
}

For users authorization on Socket Server, usessocket_secret key, which should be the same in the config files on Socket Server and API Server

API Server

For users authorization on Socket Server, usessocket_secret key, which should be the same in the config files on Socket Server and API Server

Messenger App

How to get AWS access key and secret key

Note

About socket secret

socket_secret is needed to calculate the authorization token on Socket Server.

(user_token === md5(user_id + socket_secret))

user_token is generated on API Server during authorization and transmitted when application establishes a connection with Socket Server

Last updated

Was this helpful?