Hi,

I am having trouble with getting the node.js server to send messages it has received to clients, specifically when using the Chatroom module. It is working correctly on development localhost.

The nodejs module and server versions are compatible (according to the nodejs module releases page). Also, I checked the node.js server and it is running correctly (socket.io.js can be accessed and drupal status report). A message that has been entered into the Chatroom window would not appear until the web page has been refreshed.

Versions:
Drupal 7.41
Nodejs 7.x-1.12
Nodejs server 1.0.9

Hosting:
Drupal site (HTTPS) on siteground.com
Node.js Node.js server on Heroku

node.js server settings on Drupal:

Protocol used by Node.js server: HTTPS
Node.js server host: tapchat2.herokuapp.com
Node.js server port: 443

nodejs.config file:

settings = {
  scheme: 'http',
  port: process.env.PORT,
  host: '',      //default is 'localhost'
  resource: '/socket.io',
  serviceKey: 'key',
  backend: {
    port: 80,
    host: 'tapcreative.services',
    scheme: 'https',
    basePath: '',
    messagePath: '/nodejs/message'
  },
  debug: true,
  sslKeyPath: '',
  sslCertPath: '',
  sslCAPath: '',
  baseAuthPath: '/nodejs/',
  extensions: [],
  clientsCanWriteToChannels: false,
  clientsCanWriteToClients: false,
  transports: ['websocket', 'polling', 'xhr-polling'],
  jsMinification: true,
  jsEtag: true,
  logLevel: 1
};

I have been working on this for too long and am desperate and appreciate any suggestions.

Thanks,
Peide

Comments

png created an issue. See original summary.

png’s picture

Issue summary: View changes
png’s picture

glekli’s picture

The first thing that stands out is that in the 'backend' settings of the node.js app, you have port 80 and 'https'. For https, you should set the port to 443.

Do you get any error in the node.js log or drupal log or in heroku?

Can you check what is the actual url that the browser is trying to connect to? (open the 'network' tab on the dev toolbar and look for something containing 'tapchat2.herokuapp.com')

Also, is there a reason you opened to issues for this problem?

png’s picture

Hi Gergely,

Changing port to 443 worked for me.

It's my bad, I definitely wasn't aware enough to know to use port 443 for HTTPS, because this was my first time deploying a live site. Even though I had read briefly about ports and HTTPS during my research.

Thank you so much for your help and I appreciate it,

Peide

png’s picture

Status: Active » Closed (fixed)