Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bash
bash
module.exports = {
    port: 3000,
    chat_server_key: "your-chat-server-key",
    secure: true, // use ssl ?
    privateKey: "./private_key.key", // path to private key ?
    cert: "./cert.crt",  // path to cert key ?
    redis: {
        host: '127.0.0.1domain-name',
        port: 6379
    }
};

Note: In case you are using Nginx server, you can add below configurations to your server instead of updating file config.js as above. Don't forget to update the path for your certificate and private key files. (For many distributions, the file will be located at /etc/nginx/nginx.conf. If it does not exist there, it may also be at /usr/local/nginx/conf/nginx.conf or /usr/local/etc/nginx/nginx.conf)

Code Block
bash
bash
# your SSL configuration
#ssl on;
#ssl_certificate /path/to/ssl_cert.crt;
#ssl_certificate_key /path/to/ssl_private_key.key;

location /socket.io/ {
    # switch off logging
    access_log off;

    # redirect all HTTP traffic to 127.0.0.1domain-name:3000
    proxy_pass httphttps://127.0.0.1your-domain-name:3000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # WebSocket support (nginx 1.4)
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

...

With both NodeJS and Redis installed you can now visit your AdminCP and head over to the IM App: AdminCP > Apps > IM

For the setting the Provide your Node JS server setting enter: http://your-nodejs-server.com:3000 or https://your-nodejs-server.com:3000

  • If your site is using SSL, you need to configure this setting with domain name of NodeJS server instead of IP address. 

In Provide your Node JS server key, enter the key that you have configured in your chat server.

...