Hi. I'm trying to use this with the Views node.js module to create a realtime view of updated content.

I've got it working perfectly on a site running on my local machine but as soon as I put it on my VPS it stops working.

From comparing the logs between the working local instance and the remote one, it seems that when the site is hosted remotely nodejs is not able to authenticate the browser, and hence can't use a channel to update content. I've tried all imaginable permutations of settings in nodejs.config.js and none of them can get the server to return a value for ClientSocketId, which seems to be the key.

I keep seeing that lots of people have managed to get this to work so I'm hoping it's really simple but I can't find any reference to settings that have actually got it to work for me.

I'd be very grateful for any help.

Thanks in advance.

Current nodejs.config.js file:

/**
* This configuration file was built using the 'Node.js server configuration builder'.
* For a more fully commented example see the file nodejs.config.js.example in the root of this module
*/
backendSettings = {
  "scheme":"http",
  "host":"0.0.0.0",
  "port":8888,
  "key":"/path/to/key/file",
  "cert":"/path/to/cert/file",
  "resource":"/socket.io",
  "publishUrl":"publish",
  "serviceKey":"",
  "backend":{
  "port":80,
  "host":"IP.ADDRESS.OF.WEBSERVER",
  "messagePath":"/nodejs/message"},
  "clientsCanWriteToChannels":false,
  "clientsCanWriteToClients":false,
  "extensions":"",
  "debug":true,
  "transports":["websocket",
  "flashsocket",
  "htmlfile",
  "xhr-polling",
  "jsonp-polling"],
  "jsMinification":true,
  "jsEtag":true,
  "logLevel":1};

Comments

wikipeople13’s picture

Hi again.

Finally worked out what the issue was. In case anyone else has this difficulty (I'm a newbie and some things are not immediately obvious to me that might be taken for granted by many more IT literate people...)

The key (for me, at least) was in the nodejs server host name in the nodejs configuration settings.

I hadn't been putting it in the written format 'example.com', but had been attempting various numeric IP address based options such as 127.0.0.1 and 0.0.0.0 and the IP address of the server (lots of people on the web seem to suggest that as the solution).

The trick in the end was to use the written hostname as it appears in the /etc/hostname file on the remote server that is running nodejs. One of those things that if you know it, you know it, but if you don't, it's really hard to find out.

Hope this can be of use to someone on a similar place on the learning curve.

Thanks again for a great module!

wikipeople13’s picture

Priority: Major » Minor
Status: Active » Closed (fixed)