Drupal message log gives:

Error reaching the Node.js server at "nodejs/health/check": [-111] Connection refused.

Pretty sure there isn't enough in the documentation to get this working; plus going through issue queue i see many "answers" which contradict other answers (like where to install nodejs). So this is what i have; perhaps you can fill in the missing pieces.

- drupal-node.js installed using npm at account root (not drupal root, not drupal module folder)
- ~/node_modules/drupal-node.js/nodejs.config.js looks like this:

settings = {
  scheme: 'http',
  port: 8080,
  host: 'localhost',
  resource: '/socket.io',
  serviceKey: 'XXXXX',
  backend: {
    port: 80,
    host: 'athleteos.liquidcms.org',
    scheme: 'http',
    basePath: '/',
    messagePath: '/nodejs/message'
  },
  debug: false,
  sslKeyPath: '',
  sslCertPath: '',
  sslCAPath: '',
  baseAuthPath: '/nodejs/',
  extensions: [],
  clientsCanWriteToChannels: false,
  clientsCanWriteToClients: false,
  transports: ['websocket', 'polling'],
  jsMinification: true,
  jsEtag: true,
  logLevel: 1
};

config in Drupal looks like:

host: localhost
port: 8080
service key: XXXXX

Comments

liquidcms created an issue.

dynahiol’s picture

Having the same issue with same node installation

glekli’s picture

The configuration seems reasonable. This could easily be related to your hosting setup.
Could you try opening the node.js server's url in the browser and see if it responds? In your case it should be http://athleteos.liquidcms.org:8080
Do you see any error when you start the node.js app?
Try setting 'debug' to true, and see if there is any output in the node.js log when you open the Drupal status page.

dynahiol’s picture

I've tried https://mydomain.ltd:8080 and i get " Not Found. "
Here are my config:

backendSettings = {
"scheme":"https",
"host":"mydomain.ltd",
"port":8080,
"key":"/
/live/mydomain.ltd/privkey.pem",
"cert":"/
/live/mydomain.ltd/fullchain.pem",
"resource":"/socket.io",
"publishUrl":"publish",
"serviceKey":"xxxx",
"backend":{
"port":80,
"host":"mydomain.ltd",
"messagePath":"/nodejs/message"},
"clientsCanWriteToChannels":false,
"clientsCanWriteToClients":false,
"extensions":"",
"debug":true,
"transports":["websocket",
"polling"],
"jsMinification":true,
"jsEtag":true,
"logLevel":1};

Drupal and google consol shows that nodejs is working.